{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_fisher",
  "description": "Calculate Fisher's exact test statistic between two feature files.\n\nThis tool performs Fisher's exact test to assess the statistical significance\nof overlaps between genomic intervals in two files. It calculates the probability\nof observing the given overlap pattern by chance, providing a p-value for \nstatistical inference.\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input_a": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "First input file for comparison.\n\n**Format:** BED, GFF, VCF file with genomic intervals\n**Requirement:** Must be sorted by chromosome, then start position\n**Usage:** File A for Fisher's exact test comparison\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"intervals_a.bed\"`. "
        },
        "input_b": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Second input file for comparison.\n\n**Format:** BED, GFF, VCF file with genomic intervals\n**Requirement:** Must be sorted by chromosome, then start position\n**Usage:** File B for Fisher's exact test comparison\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"intervals_b.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:** Enforces consistent chromosome sort order\n**Example:** chr1\\t249250621\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 Fisher's exact test results.\n\nContains statistical results including p-values for overlap\nsignificance between input files.\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.txt\"`, direction: `output`, example: `\"fisher_results.txt\"`. ",
          "default": "$id.$key.output.txt"
        }
      }
    },
    "overlap options": {
      "title": "Overlap Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "merge_overlaps": {
          "type": "boolean",
          "description": "Merge overlapping intervals before analysis.\n\n**Effect:** Collapses overlapping intervals in both files\n**Usage:** Prevents double-counting of overlapping features\n**Default:** false (no merging)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "min_overlap_a": {
          "type": "number",
          "description": "Minimum overlap required as fraction of A.\n\n**Range:** 0.0 to 1.0\n**Default:** 1E-9 (effectively 1bp)\n**Example:** 0.50 requires 50% of A to be overlapped\n",
          "help_text": "Type: `double`, multiple: `False`, example: `0.5`. "
        },
        "min_overlap_b": {
          "type": "number",
          "description": "Minimum overlap required as fraction of B.\n\n**Range:** 0.0 to 1.0\n**Default:** 1E-9 (effectively 1bp)\n**Example:** 0.50 requires 50% of B to be overlapped\n",
          "help_text": "Type: `double`, multiple: `False`, example: `0.5`. "
        },
        "reciprocal": {
          "type": "boolean",
          "description": "Require reciprocal overlap for both A and B.\n\n**Effect:** Both -f and -F thresholds must be satisfied\n**Example:** With -f 0.90 -r, requires B overlaps 90% of A AND A overlaps 90% of B\n**Default:** false\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "either": {
          "type": "boolean",
          "description": "Require minimum fraction satisfied for A OR B.\n\n**Effect:** Only one of -f or -F thresholds needs to be satisfied\n**Alternative:** Without -e, both fractions must be satisfied\n**Default:** false (both required)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "strand options": {
      "title": "Strand Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "same_strand": {
          "type": "boolean",
          "description": "Require same strandedness for overlaps.\n\n**Effect:** Only report overlaps on the same strand\n**Default:** false (strand-independent)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "opposite_strand": {
          "type": "boolean",
          "description": "Require different strandedness for overlaps.\n\n**Effect:** Only report overlaps on opposite strands\n**Default:** false (strand-independent)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "format options": {
      "title": "Format Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "split": {
          "type": "boolean",
          "description": "Treat split BAM or BED12 entries as distinct intervals.\n\n**Effect:** Split multi-block entries into individual intervals\n**Usage:** For BAM alignments with gaps or BED12 entries\n**Default:** false\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "bed_output": {
          "type": "boolean",
          "description": "Write output in BED format when using BAM input.\n\n**Effect:** Forces BED output format for BAM inputs\n**Default:** false\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "header": {
          "type": "boolean",
          "description": "Print header from file A prior to results.\n\n**Effect:** Includes original header from input file A\n**Default:** false\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "advanced options": {
      "title": "Advanced Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "no_name_check": {
          "type": "boolean",
          "description": "Skip chromosome naming convention checks for sorted data.\n\n**Effect:** Allows different naming (e.g., \"chr1\" vs \"chr01\")\n**Usage:** For files with inconsistent chromosome naming\n**Default:** false (strict checking)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_buffer": {
          "type": "boolean",
          "description": "Disable buffered output.\n\n**Effect:** Print each line immediately instead of buffering\n**Usage:** For real-time processing or piping\n**Trade-off:** Slower performance but immediate output\n**Default:** false (buffered output)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "io_buffer": {
          "type": "string",
          "description": "Specify input buffer memory size.\n\n**Format:** Integer with optional K/M/G suffix\n**Example:** \"128M\" for 128 megabytes\n**Note:** No effect with compressed files\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"128M\"`. "
        }
      }
    },
    "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/overlap options"
    },
    {
      "$ref": "#/$defs/strand options"
    },
    {
      "$ref": "#/$defs/format options"
    },
    {
      "$ref": "#/$defs/advanced options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
