{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_multicov",
  "description": "Count sequence coverage for multiple BAM files at specific genomic loci.\n\nbedtools multicov counts the number of alignments from multiple BAM files that overlap \neach interval in a BED/GFF/VCF file. For each genomic interval, it reports the coverage \nfrom each BAM file in additional columns, making it ideal for comparing coverage across \nmultiple samples or conditions.\n\nThis tool is commonly used for:\n- Multi-sample coverage analysis across specific regions\n- Comparing read depths between different samples\n- Quality control of sequencing experiments\n- Preparing coverage data for differential analysis\n- Generating coverage matrices for downstream analysis\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "bams": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "exists": true,
          "description": "Input BAM files for coverage counting.\n\n**Format:** Sorted and indexed BAM files\n**Content:** Aligned sequencing reads\n**Usage:** Coverage will be calculated for each BAM file separately\n**Requirements:** Must be coordinate-sorted with corresponding .bai index files\n**Output:** Each BAM contributes one column to the output\n",
          "help_text": "Type: `file`, multiple: `True`, required, direction: `input`, example: `[\"sample1.bam\";\"sample2.bam\";\"sample3.bam\"]`. "
        },
        "bed": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "BED/GFF/VCF file with genomic intervals for coverage calculation.\n\n**Format:** BED, GFF, or VCF file with genomic coordinates\n**Content:** Intervals where coverage will be measured\n**Usage:** Each interval becomes a row in the output with coverage columns appended\n**Requirements:** Chromosome names must match BAM file references\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"regions_of_interest.bed\"`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Output file with coverage counts appended to input intervals.\n\n**Format:** Same as input BED/GFF/VCF with additional coverage columns\n**Content:** Original interval data plus one coverage column per BAM file\n**Columns:** Coverage counts are appended in the order BAM files were specified\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.bed\"`, direction: `output`, example: `\"coverage_matrix.bed\"`. ",
          "default": "$id.$key.output.bed"
        }
      }
    },
    "overlap options": {
      "title": "Overlap Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "min_overlap": {
          "type": "number",
          "description": "Minimum overlap required as a fraction of each BED interval.\n\n**Default:** 1E-9 (essentially 1 base pair)\n**Range:** 0.0 to 1.0\n**Usage:** Read must overlap at least this fraction of the interval\n**Example:** 0.5 requires read to overlap at least 50% of interval\n",
          "help_text": "Type: `double`, multiple: `False`, example: `0.1`. "
        },
        "reciprocal": {
          "type": "boolean",
          "description": "Require reciprocal overlap for both interval and read.\n\n**Usage:** Both interval and read must overlap each other by min_overlap fraction\n**Example:** With -f 0.9, interval must overlap 90% of read AND read must overlap 90% of interval\n**Effect:** More stringent overlap requirement than -f alone\n**Default:** false (only interval overlap 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": "Only count reads on the same strand as the interval.\n\n**Usage:** Requires strand information in BED file (6th column)\n**Effect:** Ignores reads on opposite strand\n**Applications:** Strand-specific RNA-seq analysis, antisense detection\n**Default:** false (count reads on both strands)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "opposite_strand": {
          "type": "boolean",
          "description": "Only count reads on the opposite strand from the interval.\n\n**Usage:** Requires strand information in BED file (6th column)  \n**Effect:** Ignores reads on same strand\n**Applications:** Antisense RNA detection, strand-specific analysis\n**Default:** false (count reads on both strands)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "read filtering": {
      "title": "Read Filtering",
      "type": "object",
      "description": "No description",
      "properties": {
        "min_quality": {
          "type": "integer",
          "description": "Minimum mapping quality (MAPQ) required for reads.\n\n**Default:** 0 (no quality filtering)\n**Range:** 0-255\n**Usage:** Higher values exclude poorly mapped reads\n**Common values:** 10, 20, 30 for increasingly stringent filtering\n",
          "help_text": "Type: `integer`, multiple: `False`, example: `20`. "
        },
        "include_duplicates": {
          "type": "boolean",
          "description": "Include duplicate reads in coverage counting.\n\n**Default:** false (exclude duplicates)\n**Usage:** Count reads marked as duplicates in BAM FLAG field\n**Applications:** When duplicates represent real biological signal\n**Effect:** May increase coverage counts significantly\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "include_failed_qc": {
          "type": "boolean",
          "description": "Include reads that failed quality control checks.\n\n**Default:** false (exclude failed QC reads)\n**Usage:** Count reads marked as QC failures in BAM FLAG field\n**Applications:** When QC failures should still be counted\n**Effect:** May include low-quality alignments\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "proper_pairs_only": {
          "type": "boolean",
          "description": "Only count reads from proper pairs.\n\n**Default:** false (count all alignments above quality threshold)\n**Usage:** Requires both reads in pair to be properly aligned\n**Applications:** Paired-end sequencing quality control\n**Effect:** Excludes singleton reads and improperly paired reads\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "advanced options": {
      "title": "Advanced Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "split": {
          "type": "boolean",
          "description": "Treat split BAM or BED12 entries as distinct intervals.\n\n**BAM context:** Count spliced alignments across individual exons\n**BED12 context:** Process each block in BED12 entry separately\n**Applications:** RNA-seq analysis, exon-specific coverage\n**Default:** false (treat as single interval)\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/overlap options"
    },
    {
      "$ref": "#/$defs/strand options"
    },
    {
      "$ref": "#/$defs/read filtering"
    },
    {
      "$ref": "#/$defs/advanced options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
