{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bcftools_norm",
  "description": "Left-align and normalize indels, check if REF alleles match the reference, split multiallelic sites into multiple rows; \nrecover multiallelics from multiple rows. \n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input VCF/BCF file.\n\nThe file to be normalized, left-aligned, and/or processed.\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"input.vcf.gz\"`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Write output to a file.\n\nIf not specified, output goes to standard output.\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.gz\"`, direction: `output`, example: `\"normalized.vcf.gz\"`. ",
          "default": "$id.$key.output.gz"
        }
      }
    },
    "options": {
      "title": "Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "atomize": {
          "type": "boolean",
          "description": "Decompose complex variants (e.g., MNVs become consecutive SNVs).\n\nBreaks down complex variants into simpler components.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "atom_overlaps": {
          "type": "string",
          "description": "Use the star allele (*) for overlapping alleles or set to missing (.).\n\n**Options:**\n- `*`: Use star allele for overlaps (default)\n- `.`: Set overlapping alleles to missing\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"*\"`, choices: ``.`, `*``. ",
          "enum": [
            ".",
            "*"
          ]
        },
        "check_ref": {
          "type": "string",
          "description": "Check REF alleles and exit (e), warn (w), exclude (x), or set (s) bad sites.\n\n**Options:**\n- `e`: exit on REF mismatch (default)\n- `w`: warn about REF mismatches\n- `x`: exclude sites with REF mismatches\n- `s`: set/fix REF mismatches\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"w\"`, choices: ``e`, `w`, `x`, `s``. ",
          "enum": [
            "e",
            "w",
            "x",
            "s"
          ]
        },
        "remove_duplicates_flag": {
          "type": "boolean",
          "description": "Remove duplicate lines of the same type.\n\nShorthand for --rm_dup exact.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "rm_dup": {
          "type": "string",
          "description": "Remove duplicate snps|indels|both|all|exact.\n\n**Options:**\n- `snps`: Remove duplicate SNPs\n- `indels`: Remove duplicate indels\n- `both`: Remove duplicate SNPs and indels\n- `all`: Remove all duplicates\n- `exact`: Remove exact duplicates only\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"exact\"`, choices: ``snps`, `indels`, `both`, `all`, `exact``. ",
          "enum": [
            "snps",
            "indels",
            "both",
            "all",
            "exact"
          ]
        },
        "exclude": {
          "type": "string",
          "description": "Do not normalize records for which the expression is true.\n\nUses bcftools expression syntax (see man page for details).\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"INFO/DP<10\"`. "
        },
        "fasta_ref": {
          "type": "string",
          "format": "path",
          "description": "Reference sequence file.\n\nRequired for checking REF alleles and left-alignment.\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"reference.fa\"`. "
        },
        "force": {
          "type": "boolean",
          "description": "Try to proceed even if malformed tags are encountered.\n\n**Warning:** Experimental feature, use at your own risk.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "gff_annot": {
          "type": "string",
          "format": "path",
          "description": "Follow HGVS 3'rule and right-align variants in transcripts on the forward strand.\n\nUses GFF annotation file for transcript information.\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"genes.gff\"`. "
        },
        "include": {
          "type": "string",
          "description": "Normalize only records for which the expression is true.\n\nUses bcftools expression syntax (see man page for details).\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"QUAL>=30\"`. "
        },
        "keep_sum": {
          "type": "string",
          "description": "Keep vector sum constant when splitting multiallelics.\n\nComma-separated list of INFO tags (see github issue #360).\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"AC,AF\"`. "
        },
        "multiallelics": {
          "type": "string",
          "description": "Split multiallelics (-) or join biallelics (+), type: snps|indels|both|any.\n\n**Options:**\n- `-both`: Split multiallelic sites (default)\n- `+both`: Join biallelic sites\n- Use `snps`, `indels`, `any` for specific variant types\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"-both\"`, choices: ``+snps`, `+indels`, `+both`, `+any`, `-snps`, `-indels`, `-both`, `-any``. ",
          "enum": [
            "+snps",
            "+indels",
            "+both",
            "+any",
            "-snps",
            "-indels",
            "-both",
            "-any"
          ]
        },
        "multi_overlaps": {
          "type": "string",
          "description": "Fill in the reference (0) or missing (.) allele when splitting multiallelics.\n\n**Options:**\n- `0`: Fill with reference allele (default)\n- `.`: Fill with missing allele\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"0\"`, choices: ``0`, `.``. ",
          "enum": [
            "0",
            "."
          ]
        },
        "no_version": {
          "type": "boolean",
          "description": "Do not append version and command line to the header.\n\nProduces cleaner output headers.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "do_not_normalize": {
          "type": "boolean",
          "description": "Do not normalize indels (with -m or -c s).\n\nSkips indel left-alignment and normalization.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "old_rec_tag": {
          "type": "string",
          "description": "Annotate modified records with INFO/STR indicating the original variant.\n\nAdds specified INFO tag to track original variants.\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"OLD_VARIANT\"`. "
        },
        "output_type": {
          "type": "string",
          "description": "Output type and compression level.\n\n**Options:**\n- `u`: uncompressed BCF\n- `b`: compressed BCF\n- `v`: uncompressed VCF (default)\n- `z`: compressed VCF (with optional compression level 0-9)\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"z\"`, choices: ``u`, `z`, `b`, `v``. ",
          "enum": [
            "u",
            "z",
            "b",
            "v"
          ]
        },
        "regions": {
          "type": "string",
          "description": "Restrict to comma-separated list of regions.\n\n**Formats supported:** chr|chr:pos|chr:beg-end|chr:beg-[,…​]\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"chr20:1000000-2000000\"`. "
        },
        "regions_file": {
          "type": "string",
          "format": "path",
          "description": "Restrict to regions listed in a file.\n\nRegions can be specified in VCF, BED, or tab-delimited format.\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"regions.bed\"`. "
        },
        "regions_overlap": {
          "type": "string",
          "description": "Include if POS in the region (0), record overlaps (1), variant overlaps (2).\n\n**Options:**\n- `0`: POS inside region (default for -t/-T)\n- `1`: overlapping records included (default for -r/-R)\n- `2`: true overlapping variation only\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"1\"`, choices: ``0`, `1`, `2``. ",
          "enum": [
            "0",
            "1",
            "2"
          ]
        },
        "strict_filter": {
          "type": "boolean",
          "description": "When merging (-m+), merged site is PASS only if all sites being merged PASS.\n\nStricter FILTER handling during multiallelic joining.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "sort": {
          "type": "string",
          "description": "Sort order: chr_pos,lex.\n\n**Options:**\n- `chr_pos`: Sort by chromosome and position (default)\n- `lex`: Lexicographic sort\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"chr_pos\"`, choices: ``chr_pos`, `lex``. ",
          "enum": [
            "chr_pos",
            "lex"
          ]
        },
        "targets": {
          "type": "string",
          "description": "Similar to --regions but streams rather than index-jumps.\n\nMore efficient for processing many small regions.\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"chr20:1000000-2000000\"`. "
        },
        "targets_file": {
          "type": "string",
          "format": "path",
          "description": "Similar to --regions_file but streams rather than index-jumps.\n\nMore efficient for processing many regions from file.\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"targets.bed\"`. "
        },
        "targets_overlap": {
          "type": "string",
          "description": "Include if POS in the region (0), record overlaps (1), variant overlaps (2).\n\nSimilar to --regions_overlap but for streaming mode.\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"0\"`, choices: ``0`, `1`, `2``. ",
          "enum": [
            "0",
            "1",
            "2"
          ]
        },
        "verbosity": {
          "type": "integer",
          "description": "Verbosity level.\n\nControls amount of diagnostic output.\n",
          "help_text": "Type: `integer`, multiple: `False`, example: `1`. "
        },
        "site_win": {
          "type": "integer",
          "description": "Buffer for sorting lines which changed position during realignment.\n\nLarger values use more memory but handle more complex rearrangements.\n",
          "help_text": "Type: `integer`, multiple: `False`, example: `1000`. "
        },
        "write_index": {
          "type": "string",
          "description": "Automatically index the output files.\n\n**Format:** Specify index format or use default.\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"tbi\"`. "
        }
      }
    },
    "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/options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
