{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_coverage",
  "description": "Calculate coverage of genomic intervals from one file over intervals in another.\n\nThis tool reports the depth and breadth of coverage of features from file B\nover the intervals in file A. It provides detailed coverage statistics including\noverlap counts, covered bases, and coverage fractions.\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input_a": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Query intervals file in BED, GFF, or VCF format.\n\n**Purpose:** Intervals for which coverage will be calculated\n**BED format:** Standard genomic interval format\n**GFF format:** Gene feature format with annotations\n**VCF format:** Variant call format\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"target_regions.bed\"`. "
        },
        "input_b": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "exists": true,
          "description": "Coverage source file(s) in BED, GFF, VCF, or BAM format.\n\n**Purpose:** Features that provide coverage over query intervals\n**Multiple files:** Can specify multiple coverage sources\n**BAM support:** Binary alignment files for sequencing coverage\n",
          "help_text": "Type: `file`, multiple: `True`, required, direction: `input`, example: `[\"alignments.bam\";\"features.bed\"]`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Output file with coverage statistics.\n\n**Default output:** For each interval in A, reports:\n1",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.txt\"`, direction: `output`, example: `\"coverage_stats.txt\"`. ",
          "default": "$id.$key.output.txt"
        }
      }
    },
    "coverage reporting": {
      "title": "Coverage Reporting",
      "type": "object",
      "description": "No description",
      "properties": {
        "histogram": {
          "type": "boolean",
          "description": "Report coverage histogram for each feature and summary.\n\n**Output format:** depth, bases at depth, feature size, percentage\n**Use case:** Detailed coverage distribution analysis\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "depth_per_position": {
          "type": "boolean",
          "description": "Report depth at each position in each interval.\n\n**Output:** One-based positions with coverage depth\n**Use case:** Position-specific coverage analysis\n**Note:** Generates large output for long intervals\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "counts_only": {
          "type": "boolean",
          "description": "Only report overlap counts, no fractions.\n\n**Simplified output:** Just the number of overlapping features\n**Use case:** When only overlap counts are needed\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "mean_depth": {
          "type": "boolean",
          "description": "Report mean coverage depth for each interval.\n\n**Output:** Average depth across all positions in interval\n**Use case:** Summary coverage statistics\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**Default:** Overlaps reported regardless of strand\n**When enabled:** Only count overlaps on same strand\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "different_strand": {
          "type": "boolean",
          "description": "Require different strandedness for overlaps.\n\n**Default:** Overlaps reported regardless of strand\n**When enabled:** Only count overlaps on opposite strand\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "overlap requirements": {
      "title": "Overlap Requirements",
      "type": "object",
      "description": "No description",
      "properties": {
        "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 (essentially 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 (essentially 1bp)\n**Example:** 0.80 requires 80% of B to overlap A\n",
          "help_text": "Type: `double`, multiple: `False`, example: `0.8`. "
        },
        "reciprocal": {
          "type": "boolean",
          "description": "Require reciprocal minimum fraction for A AND B.\n\n**Requires:** Both -f and -F fractions to be satisfied\n**Use case:** Stringent overlap requirements\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "either": {
          "type": "boolean",
          "description": "Require minimum fraction for A OR B (not both).\n\n**Default:** Both -f and -F must be satisfied\n**When enabled:** Either fraction requirement is sufficient\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/BED12 entries as distinct intervals.\n\n**BAM:** Handle spliced alignments as separate blocks\n**BED12:** Process each block independently\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**Default:** BAM input produces BAM-style output\n**When enabled:** Force BED format output\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "header": {
          "type": "boolean",
          "description": "Print header from input A file before results.\n\n**Use case:** Preserve metadata from input file\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "performance options": {
      "title": "Performance Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "sorted": {
          "type": "boolean",
          "description": "Use chromsweep algorithm for sorted input.\n\n**Requirements:** Input must be sorted by chromosome and position\n**Performance:** Faster processing for large files\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "genome": {
          "type": "string",
          "format": "path",
          "description": "Genome file for consistent chromosome ordering.\n\n**Format:** Tab-delimited chromosome names and sizes\n**Use case:** Ensure consistent sort order with -sorted option\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"genome.txt\"`. "
        },
        "no_name_check": {
          "type": "boolean",
          "description": "Don't error on different chromosome naming conventions.\n\n**Example:** Allows mixing \"chr1\" and \"chr01\"\n**Use case:** Working with files from different sources\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/coverage reporting"
    },
    {
      "$ref": "#/$defs/strand options"
    },
    {
      "$ref": "#/$defs/overlap requirements"
    },
    {
      "$ref": "#/$defs/format options"
    },
    {
      "$ref": "#/$defs/performance options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
