{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bwa_mem",
  "description": "BWA-MEM algorithm for aligning sequence reads to a reference genome.",
  "type": "object",
  "$defs": {
    "input": {
      "title": "Input",
      "type": "object",
      "description": "No description",
      "properties": {
        "index": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "BWA index base name (prefix of .amb, .ann, .bwt, .pac, .sa files).",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"reference.fasta\"`. "
        },
        "reads1": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input FASTQ file with first reads in pair (R1) or single-end reads.",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"reads_R1.fastq\"`. "
        },
        "reads2": {
          "type": "string",
          "format": "path",
          "description": "Input FASTQ file with second reads in pair (R2)",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"reads_R2.fastq\"`. "
        }
      }
    },
    "output": {
      "title": "Output",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Output SAM file",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.output.sam\"`, direction: `output`, example: `\"output.sam\"`. ",
          "default": "$id.$key.output.sam"
        }
      }
    },
    "algorithm options": {
      "title": "Algorithm Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "min_seed_length": {
          "type": "integer",
          "description": "Minimum seed length",
          "help_text": "Type: `integer`, multiple: `False`, example: `19`. "
        },
        "band_width": {
          "type": "integer",
          "description": "Band width for banded alignment",
          "help_text": "Type: `integer`, multiple: `False`, example: `100`. "
        },
        "dropoff": {
          "type": "integer",
          "description": "Off-diagonal X-dropoff",
          "help_text": "Type: `integer`, multiple: `False`, example: `100`. "
        },
        "reseed_ratio": {
          "type": "number",
          "description": "Look for internal seeds inside a seed longer than {-k} * FLOAT",
          "help_text": "Type: `double`, multiple: `False`, example: `1.5`. "
        },
        "seed_occurrence": {
          "type": "integer",
          "description": "Seed occurrence for the 3rd round seeding",
          "help_text": "Type: `integer`, multiple: `False`, example: `20`. "
        },
        "skip_seeds": {
          "type": "integer",
          "description": "Skip seeds with more than INT occurrences",
          "help_text": "Type: `integer`, multiple: `False`, example: `500`. "
        },
        "chain_drop": {
          "type": "number",
          "description": "Drop chains shorter than FLOAT fraction of the longest overlapping chain",
          "help_text": "Type: `double`, multiple: `False`, example: `0.5`. "
        },
        "seeded_bases": {
          "type": "integer",
          "description": "Discard a chain if seeded bases shorter than INT",
          "help_text": "Type: `integer`, multiple: `False`, example: `0`. "
        },
        "mate_rescue": {
          "type": "integer",
          "description": "Perform at most INT rounds of mate rescues for each read",
          "help_text": "Type: `integer`, multiple: `False`, example: `50`. "
        },
        "skip_mate_rescue": {
          "type": "boolean",
          "description": "Skip mate rescue.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "skip_pairing": {
          "type": "boolean",
          "description": "Skip pairing; mate rescue performed unless -S also in use.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "scoring options": {
      "title": "Scoring Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "match_score": {
          "type": "integer",
          "description": "Score for a sequence match",
          "help_text": "Type: `integer`, multiple: `False`, example: `1`. "
        },
        "mismatch_penalty": {
          "type": "integer",
          "description": "Penalty for a mismatch",
          "help_text": "Type: `integer`, multiple: `False`, example: `4`. "
        },
        "gap_open_penalty": {
          "type": "string",
          "description": "Gap open penalties for deletions and insertions",
          "help_text": "Type: `string`, multiple: `False`, example: `\"6,6\"`. "
        },
        "gap_extend_penalty": {
          "type": "string",
          "description": "Gap extension penalty",
          "help_text": "Type: `string`, multiple: `False`, example: `\"1,1\"`. "
        },
        "clipping_penalty": {
          "type": "string",
          "description": "Penalty for 5'- and 3'-end clipping",
          "help_text": "Type: `string`, multiple: `False`, example: `\"5,5\"`. "
        },
        "unpaired_penalty": {
          "type": "integer",
          "description": "Penalty for an unpaired read pair",
          "help_text": "Type: `integer`, multiple: `False`, example: `17`. "
        },
        "read_type": {
          "type": "string",
          "description": "Read type preset (pacbio, ont2d, intractg).",
          "help_text": "Type: `string`, multiple: `False`, choices: ``pacbio`, `ont2d`, `intractg``. ",
          "enum": [
            "pacbio",
            "ont2d",
            "intractg"
          ]
        }
      }
    },
    "input/output options": {
      "title": "Input/Output Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "smart_pairing": {
          "type": "boolean",
          "description": "Smart pairing (ignoring in2.fq).",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "read_group": {
          "type": "string",
          "description": "Read group header line such as '@RG\\tID:foo\\tSM:bar'.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"@RG\tID:sample1\tSM:sample1\"`. "
        },
        "header": {
          "type": "string",
          "description": "Insert STR to header if it starts with @; or insert lines in FILE.",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "ignore_alt": {
          "type": "boolean",
          "description": "Treat ALT contigs as part of the primary assembly.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "primary_5prime": {
          "type": "boolean",
          "description": "For split alignment, take the alignment with the smallest query (not genomic) coordinate as primary.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "keep_mapq": {
          "type": "boolean",
          "description": "Don't modify mapQ of supplementary alignments.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "batch_size": {
          "type": "integer",
          "description": "Process INT input bases in each batch regardless of nThreads.",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "verbosity": {
          "type": "integer",
          "description": "Verbosity level (1=error, 2=warning, 3=message, 4+=debugging)",
          "help_text": "Type: `integer`, multiple: `False`, choices: ``1`, `2`, `3`, `4``. ",
          "enum": [
            1,
            2,
            3,
            4
          ]
        },
        "min_score": {
          "type": "integer",
          "description": "Minimum score to output",
          "help_text": "Type: `integer`, multiple: `False`, example: `30`. "
        },
        "max_hits_xa": {
          "type": "string",
          "description": "If there are <INT hits with score >80.00% of the max score, output all in XA",
          "help_text": "Type: `string`, multiple: `False`, example: `\"5,200\"`. "
        },
        "score_fraction": {
          "type": "number",
          "description": "The fraction of the max score to use with -h",
          "help_text": "Type: `double`, multiple: `False`, example: `0.8`. "
        },
        "output_all": {
          "type": "boolean",
          "description": "Output all alignments for SE or unpaired PE.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "append_comment": {
          "type": "boolean",
          "description": "Append FASTA/FASTQ comment to SAM output.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "output_ref_header": {
          "type": "boolean",
          "description": "Output the reference FASTA header in the XR tag.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "soft_clipping": {
          "type": "boolean",
          "description": "Use soft clipping for supplementary alignments.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "mark_secondary": {
          "type": "boolean",
          "description": "Mark shorter split hits as secondary.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "output_xb": {
          "type": "boolean",
          "description": "Output XB instead of XA; XB is XA with the alignment score and mapping quality added.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "insert_size": {
          "type": "string",
          "description": "Specify the mean, standard deviation, max and min of the insert size distribution.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"500,50,800,100\"`. "
        }
      }
    },
    "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/input"
    },
    {
      "$ref": "#/$defs/output"
    },
    {
      "$ref": "#/$defs/algorithm options"
    },
    {
      "$ref": "#/$defs/scoring options"
    },
    {
      "$ref": "#/$defs/input/output options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
