{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bbmap_bbsplit",
  "description": "Split sequencing reads by mapping them to multiple references simultaneously.",
  "type": "object",
  "$defs": {
    "input": {
      "title": "Input",
      "type": "object",
      "description": "No description",
      "properties": {
        "id": {
          "type": "string",
          "description": "Sample ID",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "paired": {
          "type": "boolean",
          "description": "Paired fastq files or not?",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "input": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "description": "Input fastq files, either one or two (paired), separated by \";\".",
          "help_text": "Type: `file`, multiple: `True`, direction: `input`, example: `[\"reads.fastq\"]`. "
        },
        "ref": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "description": "Reference FASTA files, separated by \";\"",
          "help_text": "Type: `file`, multiple: `True`, direction: `input`. "
        },
        "only_build_index": {
          "type": "boolean",
          "description": "If set, only builds the index",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "build": {
          "type": "string",
          "format": "path",
          "description": "Index to be used for mapping",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`. "
        },
        "qin": {
          "type": "string",
          "description": "Set to 33 or 64 to specify input quality value ASCII offset",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "interleaved": {
          "type": "boolean",
          "description": "True forces paired/interleaved input; false forces single-ended mapping.\nIf not specified, interleaved status will be autodetected from read names.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "maxindel": {
          "type": "integer",
          "description": "Don't look for indels longer than this",
          "help_text": "Type: `integer`, multiple: `False`, example: `20`. "
        },
        "minratio": {
          "type": "number",
          "description": "Fraction of max alignment score required to keep a site",
          "help_text": "Type: `double`, multiple: `False`, example: `0.56`. "
        },
        "minhits": {
          "type": "integer",
          "description": "Minimum number of seed hits required for candidate sites",
          "help_text": "Type: `integer`, multiple: `False`, example: `1`. "
        },
        "ambiguous": {
          "type": "string",
          "description": "Set behavior on ambiguously-mapped reads (with multiple top-scoring mapping locations).\n  * best    Use the first best site (Default)\n  * toss    Consider unmapped\n  * random  Select one top-scoring site randomly\n  * all     Retain all top-scoring sites",
          "help_text": "Type: `string`, multiple: `False`, example: `\"best\"`, choices: ``best`, `toss`, `random`, `all``. ",
          "enum": [
            "best",
            "toss",
            "random",
            "all"
          ]
        },
        "ambiguous2": {
          "type": "string",
          "description": "Set behavior only for reads that map ambiguously to multiple different references.\nNormal 'ambiguous=' controls behavior on all ambiguous reads;\nAmbiguous2 excludes reads that map ambiguously within a single reference.\n  * best    Use the first best site (Default)\n  * toss    Consider unmapped\n  * all     Write a copy to the output for each reference to which it maps\n  * split   Write a copy to the AMBIGUOUS_ output for each reference to which it maps\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"best\"`, choices: ``best`, `toss`, `all`, `split``. ",
          "enum": [
            "best",
            "toss",
            "all",
            "split"
          ]
        },
        "qtrim": {
          "type": "string",
          "description": "Quality-trim ends to Q5 before mapping",
          "help_text": "Type: `string`, multiple: `False`, choices: ``l`, `r`, `lr``. ",
          "enum": [
            "l",
            "r",
            "lr"
          ]
        },
        "untrim": {
          "type": "boolean",
          "description": "Undo trimming after mapping",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "output": {
      "title": "Output",
      "type": "object",
      "description": "No description",
      "properties": {
        "index": {
          "type": "string",
          "format": "path",
          "description": "Location to write the index.\n",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.index\"`, direction: `output`, example: `\"BBSplit_index\"`. ",
          "default": "$id.$key.index"
        },
        "fastq_1": {
          "type": "string",
          "format": "path",
          "description": "Output file for read 1.\n",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.fastq_1.fastq\"`, direction: `output`, example: `\"read_out1.fastq\"`. ",
          "default": "$id.$key.fastq_1.fastq"
        },
        "fastq_2": {
          "type": "string",
          "format": "path",
          "description": "Output file for read 2.\n",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.fastq_2.fastq\"`, direction: `output`, example: `\"read_out2.fastq\"`. ",
          "default": "$id.$key.fastq_2.fastq"
        },
        "sam2bam": {
          "type": "string",
          "format": "path",
          "description": "Write a shell script to 'file' that will turn the sam output into a sorted, indexed bam file.\n",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.sam2bam.sh\"`, direction: `output`, example: `\"script.sh\"`. ",
          "default": "$id.$key.sam2bam.sh"
        },
        "scafstats": {
          "type": "string",
          "format": "path",
          "description": "Write statistics on how many reads mapped to which scaffold to this file.\n",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.scafstats.txt\"`, direction: `output`, example: `\"scaffold_stats.txt\"`. ",
          "default": "$id.$key.scafstats.txt"
        },
        "refstats": {
          "type": "string",
          "format": "path",
          "description": "Write statistics on how many reads were assigned to which reference to this file.\nUnmapped reads whose mate mapped to a reference are considered assigned and will be counted.\n",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.refstats.txt\"`, direction: `output`, example: `\"reference_stats.txt\"`. ",
          "default": "$id.$key.refstats.txt"
        },
        "nzo": {
          "type": "boolean",
          "description": "Only print lines with nonzero coverage.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "bbmap_args": {
          "type": "string",
          "description": "Additional arguments from BBMap to pass to BBSplit.\n",
          "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/input"
    },
    {
      "$ref": "#/$defs/output"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
