{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_genomecov",
  "description": "Compute the coverage of a feature file among a genome.\n\nCalculates genome-wide coverage statistics from BED, GFF, VCF, or BAM files.\nCan produce coverage histograms, per-base depth, or BedGraph format output.\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "description": "Input genomic intervals file in BED, GFF, or VCF format.\n\n**Supported formats:**\n- BED format (standard genomic intervals)\n- GFF/GTF format (gene annotations)\n- VCF format (variant calls)\n\n**Note:** Required when not using `--input_bam`\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"input.bed\"`. "
        },
        "input_bam": {
          "type": "string",
          "format": "path",
          "description": "Input BAM file for coverage calculation.\n\n**Requirements:**\n- BAM file must be sorted by position\n- When using BAM input, `--genome` option is ignored\n- Coordinates are determined from BAM header\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"input.bam\"`. "
        },
        "genome": {
          "type": "string",
          "format": "path",
          "description": "Genome file defining chromosome names and sizes.\n\n**Format:** Two-column tab-delimited file:\n```\nchr1    248956422\nchr2    242193529\n```\n\n**Note:** Required when using `--input`, ignored when using `--input_bam`\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"genome.txt\"`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Output file containing coverage information.\n\n**Output formats depend on options:**\n- **Default:** Coverage histogram (depth vs count)\n- **With `--depth`:** Per-base depth (1-based coordinates)\n- **With `--bed_graph`:** BedGraph format for genome browsers\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.txt\"`, direction: `output`, example: `\"coverage.txt\"`. ",
          "default": "$id.$key.output.txt"
        }
      }
    },
    "options": {
      "title": "Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "depth": {
          "type": "boolean",
          "description": "Report the depth at each genome position with 1-based coordinates.\n\n**Output format:** `chromosome position depth`\n\n**Default behavior:** Reports coverage histogram instead\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "depth_zero": {
          "type": "boolean",
          "description": "Report depth at each genome position with 0-based coordinates.\n\n**Features:**\n- Only reports positions with non-zero coverage\n- Uses 0-based coordinate system\n- More memory efficient than `--depth`\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "bed_graph": {
          "type": "boolean",
          "description": "Report depth in BedGraph format for genome browser visualization.\n\n**Output format:** `chromosome start end depth`\n\nSee [BedGraph specification](https://genome.ucsc.edu/goldenPath/help/bedgraph.html) for details.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "bed_graph_zero_coverage": {
          "type": "boolean",
          "description": "Report depth in BedGraph format including zero-coverage regions.\n\n**Features:**\n- Same as `--bed_graph` but includes regions with 0 coverage\n- Useful for finding uncovered regions: `grep -w 0$ output.bg`\n- Generates larger output files\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "split": {
          "type": "boolean",
          "description": "Treat \"split\" BAM or BED12 entries as distinct BED intervals.\nwhen computing coverage.\nFor BAM files, this uses the CIGAR \"N\" and \"D\" operations \nto infer the blocks for computing coverage.\nFor BED12 files, this uses the BlockCount, BlockStarts, and BlockEnds\nfields (i.e., columns 10,11,12).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "ignore_deletion": {
          "type": "boolean",
          "description": "Ignore local deletions (CIGAR \"D\" operations) in BAM entries\nwhen computing coverage.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "strand": {
          "type": "string",
          "description": "Calculate coverage of intervals from a specific strand.\nWith BED files, requires at least 6 columns (strand is column 6)",
          "help_text": "Type: `string`, multiple: `False`, choices: ``+`, `-``. ",
          "enum": [
            "+",
            "-"
          ]
        },
        "pair_end_coverage": {
          "type": "boolean",
          "description": "Calculate coverage of pair-end fragments.\nWorks for BAM files only\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "fragment_size": {
          "type": "boolean",
          "description": "Force to use provided fragment size instead of read length\nWorks for BAM files only\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "du": {
          "type": "boolean",
          "description": "Change strand af the mate read (so both reads from the same strand) useful for strand specific\nWorks for BAM files only\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "five_prime": {
          "type": "boolean",
          "description": "Calculate coverage of 5\" positions (instead of entire interval).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "three_prime": {
          "type": "boolean",
          "description": "Calculate coverage of 3\" positions (instead of entire interval).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "max": {
          "type": "integer",
          "description": "Combine all positions with a depth >= max into\na single bin in the histogram",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "scale": {
          "type": "number",
          "description": "Scale the coverage by a constant factor.\nEach coverage value is multiplied by this factor before being reported.\nUseful for normalizing coverage by, e.g., reads per million (RPM).\n- Default is 1.0; i.e., unscaled.\n- (FLOAT)\n",
          "help_text": "Type: `double`, multiple: `False`. "
        },
        "trackline": {
          "type": "boolean",
          "description": "Adds a UCSC/Genome-Browser track line definition in the first line of the output.\n- See here for more details about track line definition:\n      http://genome.ucsc.edu/goldenPath/help/bedgraph.html\n- NOTE: When adding a trackline definition, the output BedGraph can be easily\n      uploaded to the Genome Browser as a custom track,\n      BUT CAN NOT be converted into a BigWig file (w/o removing the first line).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "trackopts": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Writes additional track line definition parameters in the first line.\n- Example:\n  -trackopts 'name=\"My Track\" visibility=2 color=255,30,30'\n  Note the use of single-quotes if you have spaces in your parameters.\n- (TEXT)\n",
          "help_text": "Type: `string`, multiple: `True`. "
        }
      }
    },
    "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"
    }
  ]
}
