{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_flank",
  "description": "Create flanking intervals for each genomic feature.\n\nThis tool generates new intervals representing the regions immediately \nupstream and/or downstream of existing genomic features. Unlike slop which\nextends existing intervals, flank creates entirely new intervals from the\nflanking regions.\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input file with genomic intervals.\n\n**Format:** BED, GFF, VCF file with genomic intervals\n**Usage:** Features for which flanking regions will be created\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"intervals.bed\"`. "
        },
        "genome": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Genome file defining chromosome sizes.\n\n**Format:** Tab-delimited file with chromosome name and size\n**Purpose:** Prevents flanks from extending beyond chromosome boundaries\n**Example:** chr1\\t249250621\n**Tip:** Can use samtools faidx output (.fai file)\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"genome.txt\"`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Output file with flanking intervals.\n\nContains new intervals representing the flanking regions\nof the input features.\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.bed\"`, direction: `output`, example: `\"flanking_regions.bed\"`. ",
          "default": "$id.$key.output.bed"
        }
      }
    },
    "flanking options": {
      "title": "Flanking Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "both": {
          "type": "string",
          "description": "Create flanking intervals using specified distance in both directions.\n\n**Input:** Integer (base pairs) or Float (if used with --pct)\n**Effect:** Creates flanks of equal size upstream and downstream\n**Example:** \"1000\" creates 1kb flanks on both sides\n**Mutually exclusive:** Cannot use with --left or --right\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"1000\"`. "
        },
        "left": {
          "type": "string",
          "description": "Distance for left/upstream flank from original start coordinate.\n\n**Input:** Integer (base pairs) or Float (if used with --pct)\n**Strand-aware:** When used with --strand, respects feature orientation\n**Example:** \"500\" creates 500bp upstream flank\n**Requires:** Must be used together with --right\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"500\"`. "
        },
        "right": {
          "type": "string",
          "description": "Distance for right/downstream flank from original end coordinate.\n\n**Input:** Integer (base pairs) or Float (if used with --pct)\n**Strand-aware:** When used with --strand, respects feature orientation\n**Example:** \"300\" creates 300bp downstream flank  \n**Requires:** Must be used together with --left\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"300\"`. "
        }
      }
    },
    "flanking behavior": {
      "title": "Flanking Behavior",
      "type": "object",
      "description": "No description",
      "properties": {
        "strand": {
          "type": "boolean",
          "description": "Define left and right flanks based on strand orientation.\n\n**Effect:** For negative-strand features, left becomes downstream\n**Example:** -l 500 on minus strand starts flank 500bp downstream\n**Default:** false (ignore strand)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "percent": {
          "type": "boolean",
          "description": "Define flanking distances as fraction of feature length.\n\n**Effect:** Distances become proportional to feature size\n**Example:** -l 0.5 on 1000bp feature creates 500bp upstream flank\n**Input format:** Use decimals (e.g., \"0.1\" for 10%)\n**Default:** false (absolute base pairs)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "output options": {
      "title": "Output Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "header": {
          "type": "boolean",
          "description": "Print header from input file prior to results.\n\n**Effect:** Preserves original file header in output\n**Default:** false\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/flanking options"
    },
    {
      "$ref": "#/$defs/flanking behavior"
    },
    {
      "$ref": "#/$defs/output options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
