{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_sort",
  "description": "Sorts genomic feature files by chromosome and other criteria.\n\nThis tool provides flexible sorting options for BED, GFF, and VCF files,\nincluding chromosome-based sorting, feature size sorting, score-based sorting,\nand custom chromosome ordering using genome files.\n\n**Default behavior:** Sorts by chromosome name, then by start position\n**Custom ordering:** Use --genome or --faidx to specify chromosome order\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input genomic feature file to be sorted.\n\n**Supported formats:** BED, GFF, VCF\n**Requirements:** File should contain valid genomic intervals\n**Note:** File does not need to be pre-sorted\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"unsorted_features.bed\"`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Output file containing sorted genomic features.\n\nThe output will be in the same format as the input file,\nwith features sorted according to the specified criteria.\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.bed\"`, direction: `output`, example: `\"sorted_features.bed\"`. ",
          "default": "$id.$key.output.bed"
        }
      }
    },
    "options": {
      "title": "Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "sizeA": {
          "type": "boolean",
          "description": "Sort by feature size in ascending order.\n\nFeatures are sorted by their span (end - start) from smallest\nto largest, regardless of chromosome location.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "sizeD": {
          "type": "boolean",
          "description": "Sort by feature size in descending order.\n\nFeatures are sorted by their span (end - start) from largest\nto smallest, regardless of chromosome location.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "chrThenSizeA": {
          "type": "boolean",
          "description": "Sort by chromosome, then by feature size (ascending).\n\n**Primary sort:** Chromosome name (lexicographic)\n**Secondary sort:** Feature size (smallest to largest)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "chrThenSizeD": {
          "type": "boolean",
          "description": "Sort by chromosome, then by feature size (descending).\n\n**Primary sort:** Chromosome name (lexicographic)  \n**Secondary sort:** Feature size (largest to smallest)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "chrThenScoreA": {
          "type": "boolean",
          "description": "Sort by chromosome, then by score (ascending).\n\n**Primary sort:** Chromosome name (lexicographic)\n**Secondary sort:** Score field (lowest to highest)\n**Requirements:** Input must have score column (typically column 5 in BED)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "chrThenScoreD": {
          "type": "boolean",
          "description": "Sort by chromosome, then by score (descending).\n\n**Primary sort:** Chromosome name (lexicographic)\n**Secondary sort:** Score field (highest to lowest)  \n**Requirements:** Input must have score column (typically column 5 in BED)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "genome": {
          "type": "string",
          "format": "path",
          "description": "Custom chromosome ordering file.\n\nText file with one chromosome name per line, defining the desired\nchromosome order",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"genome_order.txt\"`. "
        },
        "faidx": {
          "type": "string",
          "format": "path",
          "description": "FASTA index file for chromosome ordering.\n\nUses a FASTA index file (.fai) to determine chromosome order.\nThe chromosomes will be sorted according to their order in the\nindex file.\n\n**Format:** Standard samtools faidx output format\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"reference.fa.fai\"`. "
        },
        "header": {
          "type": "boolean",
          "description": "Preserve header lines in output.\n\nHeader lines (starting with '#' or other format-specific prefixes)\nfrom the input file will be printed before the sorted features.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": 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"
    }
  ]
}
