{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "umi_tools_dedup",
  "description": "Deduplicate reads based on the mapping co-ordinate and the UMI attached to the read.\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input BAM or SAM file",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`. "
        },
        "in_sam": {
          "type": "boolean",
          "description": "By default, inputs are assumed to be in BAM format",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "bai": {
          "type": "string",
          "format": "path",
          "description": "BAM index",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`. "
        },
        "random_seed": {
          "type": "integer",
          "description": "Random seed to initialize number generator with.",
          "help_text": "Type: `integer`, multiple: `False`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Deduplicated BAM file.",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output\"`, direction: `output`. ",
          "default": "$id.$key.output"
        },
        "out_sam": {
          "type": "boolean",
          "description": "By default, outputa are written in BAM format",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "paired": {
          "type": "boolean",
          "description": "BAM is paired end - output both read pairs",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "output_stats": {
          "type": "string",
          "description": "Generate files containing UMI based deduplication statistics files with this prefix in the file names.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "extract_umi_method": {
          "type": "string",
          "description": "Specify the method by which the barcodes were encoded in the read.\nThe options are:\n  * read_id (default) \n  * tag\n  * umis\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"read_id\"`, choices: ``read_id`, `tag`, `umis``. ",
          "enum": [
            "read_id",
            "tag",
            "umis"
          ]
        },
        "umi_tag": {
          "type": "string",
          "description": "The tag containing the UMI sequence",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "umi_separator": {
          "type": "string",
          "description": "The separator used to separate the UMI from the read sequence",
          "help_text": "Type: `string`, multiple: `False`, example: `\"_\"`. "
        },
        "umi_tag_split": {
          "type": "string",
          "description": "Separate the UMI in tag by <SPLIT> and take the first element.",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "umi_tag_delimiter": {
          "type": "string",
          "description": "Separate the UMI in by <DELIMITER> and concatenate the elements.",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "cell_tag": {
          "type": "string",
          "description": "The tag containing the cell barcode sequence",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "cell_tag_split": {
          "type": "string",
          "description": "Separate the cell barcode in tag by <SPLIT> and take the first element.",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "cell_tag_delimiter": {
          "type": "string",
          "description": "Separate the cell barcode in by <DELIMITER> and concatenate the elements.",
          "help_text": "Type: `string`, multiple: `False`. "
        }
      }
    },
    "grouping options": {
      "title": "Grouping Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "method": {
          "type": "string",
          "description": "The method to use for grouping reads",
          "help_text": "Type: `string`, multiple: `False`, example: `\"directional\"`, choices: ``unique`, `percentile`, `cluster`, `adjacency`, `directional``. ",
          "enum": [
            "unique",
            "percentile",
            "cluster",
            "adjacency",
            "directional"
          ]
        },
        "edit_distance_threshold": {
          "type": "integer",
          "description": "For the adjacency and cluster methods the threshold for the edit distance to connect two\nUMIs in the network can be increased",
          "help_text": "Type: `integer`, multiple: `False`, example: `1`. "
        },
        "spliced_is_unique": {
          "type": "boolean",
          "description": "Causes two reads that start in the same position on the same strand and having the same UMI\nto be considered unique if one is spliced and the other is not",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "soft_clip_threshold": {
          "type": "integer",
          "description": "Mappers that soft clip will sometimes do so rather than mapping a spliced read if there is only\na small overhang over the exon junction",
          "help_text": "Type: `integer`, multiple: `False`, example: `4`. "
        },
        "multimapping_detection_method": {
          "type": "string",
          "description": "If the sam/bam contains tags to identify multimapping reads, you can specify for use when selecting\nthe best read at a given loci",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "read_length": {
          "type": "boolean",
          "description": "Use the read length as a criteria when deduping, for e.g",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "single-cell rna-seq options": {
      "title": "Single-cell RNA-Seq Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "per_gene": {
          "type": "boolean",
          "description": "Reads will be grouped together if they have the same gene",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "gene_tag": {
          "type": "string",
          "description": "Deduplicate per gene",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "assigned_status_tag": {
          "type": "string",
          "description": "BAM tag which describes whether a read is assigned to a gene",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "skip_tags_regex": {
          "type": "string",
          "description": "Use in conjunction with the --assigned_status_tag option to skip any reads where the tag matches\nthis regex",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "per_contig": {
          "type": "boolean",
          "description": "Deduplicate per contig (field 3 in BAM; RNAME)",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "gene_transcript_map": {
          "type": "string",
          "format": "path",
          "description": "A file containing a mapping between gene names and transcript names",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`. "
        },
        "per_cell": {
          "type": "boolean",
          "description": "Reads will only be grouped together if they have the same cell barcode",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "sam/bam options": {
      "title": "SAM/BAM Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "mapping_quality": {
          "type": "integer",
          "description": "Minimium mapping quality (MAPQ) for a read to be retained",
          "help_text": "Type: `integer`, multiple: `False`, example: `0`. "
        },
        "unmapped_reads": {
          "type": "string",
          "description": "How unmapped reads should be handled",
          "help_text": "Type: `string`, multiple: `False`, example: `\"discard\"`. "
        },
        "chimeric_pairs": {
          "type": "string",
          "description": "How chimeric pairs should be handled",
          "help_text": "Type: `string`, multiple: `False`, example: `\"use\"`, choices: ``discard`, `use`, `output``. ",
          "enum": [
            "discard",
            "use",
            "output"
          ]
        },
        "unpaired_reads": {
          "type": "string",
          "description": "How unpaired reads should be handled",
          "help_text": "Type: `string`, multiple: `False`, example: `\"use\"`, choices: ``discard`, `use`, `output``. ",
          "enum": [
            "discard",
            "use",
            "output"
          ]
        },
        "ignore_umi": {
          "type": "boolean",
          "description": "Ignore the UMI and group reads using mapping coordinates only.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "subset": {
          "type": "number",
          "description": "Only consider a fraction of the reads, chosen at random",
          "help_text": "Type: `double`, multiple: `False`. "
        },
        "chrom": {
          "type": "string",
          "description": "Only consider a single chromosome",
          "help_text": "Type: `string`, multiple: `False`. "
        }
      }
    },
    "group/dedup options": {
      "title": "Group/Dedup Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "no_sort_output": {
          "type": "boolean",
          "description": "By default, output is sorted",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "buffer_whole_contig": {
          "type": "boolean",
          "description": "Forces dedup to parse an entire contig before yielding any reads for deduplication",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "common options": {
      "title": "Common Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "log": {
          "type": "string",
          "format": "path",
          "description": "File with logging information.",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`. "
        },
        "log2stderr": {
          "type": "boolean",
          "description": "Send logging information to stderr.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "verbose": {
          "type": "integer",
          "description": "Log level",
          "help_text": "Type: `integer`, multiple: `False`, example: `0`. "
        },
        "error": {
          "type": "string",
          "format": "path",
          "description": "File with error information.",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`. "
        },
        "temp_dir": {
          "type": "string",
          "description": "Directory for temporary files",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "compresslevel": {
          "type": "integer",
          "description": "Level of Gzip compression to use",
          "help_text": "Type: `integer`, multiple: `False`, example: `6`. "
        },
        "timeit": {
          "type": "string",
          "format": "path",
          "description": "Store timing information in file.",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`. "
        },
        "timeit_name": {
          "type": "string",
          "description": "Name in timing file for this class of jobs",
          "help_text": "Type: `string`, multiple: `False`, example: `\"all\"`. "
        },
        "timeit_header": {
          "type": "string",
          "description": "Add header for timing information.",
          "help_text": "Type: `string`, multiple: `False`. "
        }
      }
    },
    "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/grouping options"
    },
    {
      "$ref": "#/$defs/single-cell rna-seq options"
    },
    {
      "$ref": "#/$defs/sam/bam options"
    },
    {
      "$ref": "#/$defs/group/dedup options"
    },
    {
      "$ref": "#/$defs/common options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
