{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "samtools_sort",
  "description": "Sort SAM/BAM/CRAM file.",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "SAM/BAM/CRAM input file.",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Write final output to file.\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.bam\"`, direction: `output`, example: `\"out.bam\"`. ",
          "default": "$id.$key.output.bam"
        },
        "output_fmt": {
          "type": "string",
          "description": "Specify output format (SAM, BAM, CRAM).\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"BAM\"`. "
        },
        "output_fmt_option": {
          "type": "string",
          "description": "Specify a single output file format option in the form\nof OPTION or OPTION=VALUE.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "reference": {
          "type": "string",
          "format": "path",
          "description": "Reference sequence FASTA FILE.\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"ref.fa\"`. "
        },
        "write_index": {
          "type": "boolean",
          "description": "Automatically index the output files.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "prefix": {
          "type": "string",
          "description": "Write temporary files to PREFIX.nnnn.bam.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "no_PG": {
          "type": "boolean",
          "description": "Do not add a PG line.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "template_coordinate": {
          "type": "boolean",
          "description": "Sort by template-coordinate.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "input_fmt_option": {
          "type": "string",
          "description": "Specify a single input file format option in the form\nof OPTION or OPTION=VALUE.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        }
      }
    },
    "options": {
      "title": "Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "compression": {
          "type": "integer",
          "description": "Set compression level, from 0 (uncompressed) to 9 (best).\n",
          "help_text": "Type: `integer`, multiple: `False`, default: `0`. ",
          "default": 0
        },
        "uncompressed": {
          "type": "boolean",
          "description": "Output uncompressed data (equivalent to --compression 0).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "minimiser": {
          "type": "boolean",
          "description": "Use minimiser for clustering unaligned/unplaced reads.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "not_reverse": {
          "type": "boolean",
          "description": "Do not use reverse strand (only compatible with --minimiser)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "kmer_size": {
          "type": "integer",
          "description": "Kmer size to use for minimiser.\n",
          "help_text": "Type: `integer`, multiple: `False`, example: `20`. "
        },
        "order": {
          "type": "string",
          "format": "path",
          "description": "Order minimisers by their position in FILE FASTA.\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"ref.fa\"`. "
        },
        "window": {
          "type": "integer",
          "description": "Window size for minimiser INDEXING VIA --order REF.FA.\n",
          "help_text": "Type: `integer`, multiple: `False`, example: `100`. "
        },
        "homopolymers": {
          "type": "boolean",
          "description": "Squash homopolymers when computing minimiser.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "natural_sort": {
          "type": "boolean",
          "description": "Sort by read name (natural): cannot be used with samtools index.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "ascii_sort": {
          "type": "boolean",
          "description": "Sort by read name (ASCII): cannot be used with samtools index.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "tag": {
          "type": "string",
          "description": "Sort by value of TAG",
          "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/options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
