{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "process_singlesample",
  "description": "A pipeline to analyse a single multiomics sample.",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Path to the sample.",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"input.h5mu\"`. "
        },
        "rna_layer": {
          "type": "string",
          "description": "Input layer for the gene expression modality",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "prot_layer": {
          "type": "string",
          "description": "Input layer for the antibody capture modality",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "gdo_layer": {
          "type": "string",
          "description": "Input layer for the guide-derived oligonucleotide (GDO) data",
          "help_text": "Type: `string`, multiple: `False`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Destination path to the output.",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.h5mu\"`, direction: `output`, example: `\"output.h5mu\"`. ",
          "default": "$id.$key.output.h5mu"
        }
      }
    },
    "sample id options": {
      "title": "Sample ID options",
      "type": "object",
      "description": "Options for adding the id to .obs on the MuData object. Having a sample \nid present in a requirement of several components for this pipeline.\n",
      "properties": {
        "add_id_to_obs": {
          "type": "boolean",
          "description": "Add the value passed with --id to .obs.",
          "help_text": "Type: `boolean`, multiple: `False`, default: `true`. ",
          "default": true
        },
        "add_id_obs_output": {
          "type": "string",
          "description": ".Obs column to add the sample IDs to",
          "help_text": "Type: `string`, multiple: `False`, default: `\"sample_id\"`. ",
          "default": "sample_id"
        },
        "add_id_make_observation_keys_unique": {
          "type": "boolean",
          "description": "Join the id to the .obs index (.obs_names)",
          "help_text": "Type: `boolean`, multiple: `False`, default: `true`. ",
          "default": true
        }
      }
    },
    "rna filtering options": {
      "title": "RNA filtering options",
      "type": "object",
      "description": "No description",
      "properties": {
        "rna_min_counts": {
          "type": "integer",
          "description": "Minimum number of counts captured per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `200`. "
        },
        "rna_max_counts": {
          "type": "integer",
          "description": "Maximum number of counts captured per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `5000000`. "
        },
        "rna_min_percentile_counts": {
          "type": "number",
          "description": "Minimum percentile of total RNA counts captured per cell",
          "help_text": "Type: `double`, multiple: `False`, example: `0.05`. "
        },
        "rna_max_percentile_counts": {
          "type": "number",
          "description": "Maximum percentile of total RNA counts captured per cell",
          "help_text": "Type: `double`, multiple: `False`, example: `0.95`. "
        },
        "rna_min_genes_per_cell": {
          "type": "integer",
          "description": "Minimum of non-zero values per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `200`. "
        },
        "rna_max_genes_per_cell": {
          "type": "integer",
          "description": "Maximum of non-zero values per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `1500000`. "
        },
        "rna_min_cells_per_gene": {
          "type": "integer",
          "description": "Minimum of non-zero values per gene.",
          "help_text": "Type: `integer`, multiple: `False`, example: `3`. "
        },
        "rna_min_fraction_mito": {
          "type": "number",
          "description": "Minimum fraction of UMIs that are mitochondrial.",
          "help_text": "Type: `double`, multiple: `False`, example: `0.0`. "
        },
        "rna_max_fraction_mito": {
          "type": "number",
          "description": "Maximum fraction of UMIs that are mitochondrial.",
          "help_text": "Type: `double`, multiple: `False`, example: `0.2`. "
        },
        "rna_min_fraction_ribo": {
          "type": "number",
          "description": "Minimum fraction of UMIs that are mitochondrial.",
          "help_text": "Type: `double`, multiple: `False`, example: `0.0`. "
        },
        "rna_max_fraction_ribo": {
          "type": "number",
          "description": "Maximum fraction of UMIs that are mitochondrial.",
          "help_text": "Type: `double`, multiple: `False`, example: `0.2`. "
        },
        "skip_scrublet_doublet_detection": {
          "type": "boolean",
          "description": "Skip the scrublet doublet detection step.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "scrublet_do_subset": {
          "type": "boolean",
          "description": "Remove cells classified as doublets by scrublet from the output",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "scrublet_score_threshold": {
          "type": "number",
          "description": "Manual doublet score threshold passed to filter_with_scrublet",
          "help_text": "Type: `double`, multiple: `False`. "
        },
        "scrublet_expected_doublet_rate": {
          "type": "number",
          "description": "The estimated fraction of doublets as from the experimental setup.\n",
          "help_text": "Type: `double`, multiple: `False`. "
        },
        "scrublet_stdev_doublet_rate": {
          "type": "number",
          "description": "Uncertainty in the expected doublet rate.",
          "help_text": "Type: `double`, multiple: `False`. "
        },
        "scrublet_n_neighbors": {
          "type": "integer",
          "description": "Number of neighbors used to construct the KNN classifier of observed transcriptomes\nand simulated doublets.\n",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "scrublet_sim_doublet_ratio": {
          "type": "number",
          "description": "Number of doublets to simulate relative to the number of observed transcriptomes.\n",
          "help_text": "Type: `double`, multiple: `False`. "
        },
        "scrublet_min_counts": {
          "type": "integer",
          "description": "The number of minimal UMI counts per cell that have to be present for initial cell\ndetection during scrublet doublet detection.\n",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "scrublet_min_cells": {
          "type": "integer",
          "description": "The number of cells in which UMIs for a gene were detected during scrublet\ndoublet detection.\n",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "scrublet_min_gene_variability_percent": {
          "type": "number",
          "description": "Keep the most highly variable genes (in the top percentile) as measured by the\nv-statistic, used for gene filtering prior to PCA during scrublet doublet detection.\n",
          "help_text": "Type: `double`, multiple: `False`. "
        },
        "scrublet_num_pca_components": {
          "type": "integer",
          "description": "Number of principal components used during PCA dimensionality reduction in scrublet\ndoublet detection.\n",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "scrublet_distance_metric": {
          "type": "string",
          "description": "The distance metric used for computing similarities during scrublet doublet detection.",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "scrublet_allow_automatic_threshold_detection_fail": {
          "type": "boolean",
          "description": "When scrublet fails to automatically determine the doublet score threshold, allow the\npipeline to continue and set the output columns to NA.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "cite-seq filtering options": {
      "title": "CITE-seq filtering options",
      "type": "object",
      "description": "No description",
      "properties": {
        "prot_min_counts": {
          "type": "integer",
          "description": "Minimum number of counts per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `3`. "
        },
        "prot_max_counts": {
          "type": "integer",
          "description": "Minimum number of counts per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `5000000`. "
        },
        "prot_min_percentile_counts": {
          "type": "number",
          "description": "Minimum percentile of total protein counts captured per cell",
          "help_text": "Type: `double`, multiple: `False`, example: `0.05`. "
        },
        "prot_max_percentile_counts": {
          "type": "number",
          "description": "Maximum percentile of total protein counts captured per cell",
          "help_text": "Type: `double`, multiple: `False`, example: `0.95`. "
        },
        "prot_min_proteins_per_cell": {
          "type": "integer",
          "description": "Minimum of non-zero values per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `200`. "
        },
        "prot_max_proteins_per_cell": {
          "type": "integer",
          "description": "Maximum of non-zero values per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `100000000`. "
        },
        "prot_min_cells_per_protein": {
          "type": "integer",
          "description": "Minimum of non-zero values per protein.",
          "help_text": "Type: `integer`, multiple: `False`, example: `3`. "
        }
      }
    },
    "gdo filtering options": {
      "title": "GDO filtering options",
      "type": "object",
      "description": "No description",
      "properties": {
        "gdo_min_counts": {
          "type": "integer",
          "description": "Minimum number of counts per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `3`. "
        },
        "gdo_max_counts": {
          "type": "integer",
          "description": "Minimum number of counts per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `5000000`. "
        },
        "gdo_min_guides_per_cell": {
          "type": "integer",
          "description": "Minimum of non-zero values per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `200`. "
        },
        "gdo_max_guides_per_cell": {
          "type": "integer",
          "description": "Maximum of non-zero values per cell.",
          "help_text": "Type: `integer`, multiple: `False`, example: `100000000`. "
        },
        "gdo_min_cells_per_guide": {
          "type": "integer",
          "description": "Minimum of non-zero values per guide.",
          "help_text": "Type: `integer`, multiple: `False`, example: `3`. "
        }
      }
    },
    "mitochondrial & ribosomal gene detection": {
      "title": "Mitochondrial & Ribosomal Gene Detection",
      "type": "object",
      "description": "No description",
      "properties": {
        "var_gene_names": {
          "type": "string",
          "description": ".var column name to be used to detect mitochondrial/ribosomal genes instead of .var_names (default if not set).\nGene names matching with the regex value from --mitochondrial_gene_regex or --ribosomal_gene_regex will be \nidentified as mitochondrial or ribosomal genes, respectively",
          "help_text": "Type: `string`, multiple: `False`, example: `\"gene_symbol\"`. "
        },
        "var_name_mitochondrial_genes": {
          "type": "string",
          "description": "In which .var slot to store a boolean array corresponding the mitochondrial genes.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "obs_name_mitochondrial_fraction": {
          "type": "string",
          "description": "When specified, write the fraction of counts originating from mitochondrial genes \n(based on --mitochondrial_gene_regex) to an .obs column with the specified name.\nRequires --var_name_mitochondrial_genes.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "mitochondrial_gene_regex": {
          "type": "string",
          "description": "Regex string that identifies mitochondrial genes from --var_gene_names.\nBy default will detect human and mouse mitochondrial genes from a gene symbol.\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"^[mM][tT]-\"`. ",
          "default": "^[mM][tT]-"
        },
        "var_name_ribosomal_genes": {
          "type": "string",
          "description": "In which .var slot to store a boolean array corresponding the ribosomal genes.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "obs_name_ribosomal_fraction": {
          "type": "string",
          "description": "When specified, write the fraction of counts originating from ribosomal genes \n(based on --ribosomal_gene_regex) to an .obs column with the specified name.\nRequires --var_name_ribosomal_genes.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "ribosomal_gene_regex": {
          "type": "string",
          "description": "Regex string that identifies ribosomal genes from --var_gene_names.\nBy default will detect human and mouse ribosomal genes from a gene symbol.\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"^[Mm]?[Rr][Pp][LlSs]\"`. ",
          "default": "^[Mm]?[Rr][Pp][LlSs]"
        }
      }
    },
    "cross-modality filtering": {
      "title": "Cross-modality filtering",
      "type": "object",
      "description": "No description",
      "properties": {
        "intersect_obs": {
          "type": "boolean",
          "description": "After per-modality filtering, remove observations that are not present\nin all processed modalities so that each modality shares the same set of cells.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "qc metrics calculation options": {
      "title": "QC metrics calculation options",
      "type": "object",
      "description": "Options for calculating basic quality control metrics on the processed\nRNA and protein modalities. These metrics are added to the .obs and .var\nof the output. Mitochondrial and ribosomal genes used for the metrics are\ndetected during single-sample processing (see the options above).\n",
      "properties": {
        "skip_qc_metrics": {
          "type": "boolean",
          "description": "Skip the calculation of QC metrics",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "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",
          "help_text": "Type: `string`, multiple: `True`, example: `[\"ercc,highly_variable\"]`. "
        },
        "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`, default: `[50,100,200,500]`. ",
          "default": [
            50,
            100,
            200,
            500
          ]
        },
        "log1p_transform": {
          "type": "boolean",
          "description": "Compute log1p-transformed versions of the calculated QC metrics",
          "help_text": "Type: `boolean`, multiple: `False`, default: `true`. ",
          "default": 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"
        },
        "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/sample id options"
    },
    {
      "$ref": "#/$defs/rna filtering options"
    },
    {
      "$ref": "#/$defs/cite-seq filtering options"
    },
    {
      "$ref": "#/$defs/gdo filtering options"
    },
    {
      "$ref": "#/$defs/mitochondrial & ribosomal gene detection"
    },
    {
      "$ref": "#/$defs/cross-modality filtering"
    },
    {
      "$ref": "#/$defs/qc metrics calculation options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
