{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_pairtobed",
  "description": "Report overlaps between a BEDPE file and a BED/GFF/VCF file.\n\nbedtools pairtobed finds overlaps between paired-end intervals (BEDPE format) \nand genomic features in BED/GFF/VCF format. This tool is particularly useful \nfor analyzing paired-end sequencing data, structural variants, or any genomic \ndata where you need to consider relationships between paired intervals.\n\nThis tool is commonly used for:\n- Annotating structural variants with genomic features\n- Finding overlaps between paired-end ChIP-seq reads and genes\n- Analyzing chromatin interactions (Hi-C, ChIA-PET) with genomic annotations\n- Quality control of paired-end sequencing experiments\n- Intersecting BEDPE format data with reference annotations\n- Processing BAM files with paired-end alignment information\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "bedpe": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input BEDPE file with paired interval data.\n\n**Format:** BEDPE format with paired genomic coordinates\n**Content:** Each line represents a pair of genomic intervals\n**Columns:** chrom1, start1, end1, chrom2, start2, end2, [name], [score], [strand1], [strand2]\n**Usage:** Pairs will be tested for overlaps with features in --bed file\n**Requirements:** Must be in valid BEDPE format\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"structural_variants.bedpe\"`. "
        },
        "bed": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input BED/GFF/VCF file with genomic features.\n\n**Format:** BED, GFF, or VCF file with genomic coordinates\n**Content:** Genomic features to test for overlaps with BEDPE pairs\n**Usage:** Features will be intersected with paired intervals from --bedpe\n**Requirements:** Standard genomic coordinate format\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"genes.bed\"`. "
        },
        "bam_input": {
          "type": "string",
          "format": "path",
          "description": "Input BAM file instead of BEDPE file.\n\n**Format:** BAM format with paired-end alignments\n**Content:** Paired-end sequencing reads\n**Requirements:** Must be grouped or sorted by query name\n**Usage:** Replaces --bedpe argument when working with BAM input\n**Output:** Will produce BAM output by default (unless --bedpe_output is used)\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"paired_reads.bam\"`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Output file with overlap results.\n\n**Format:** Depends on input type and options\n**BAM input:** BAM format (unless --bedpe_output specified)\n**BEDPE input:** BEDPE format with overlapping pairs\n**Content:** Original paired intervals that meet the overlap criteria\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.bedpe\"`, direction: `output`, example: `\"overlapping_pairs.bedpe\"`. ",
          "default": "$id.$key.output.bedpe"
        }
      }
    },
    "output options": {
      "title": "Output Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "uncompressed_bam": {
          "type": "boolean",
          "description": "Write uncompressed BAM output.\n\n**Usage:** Only applies when using BAM input (--bam_input)\n**Default:** Compressed BAM output\n**Effect:** Produces larger but faster-to-write output files\n**Applications:** When downstream tools require uncompressed BAM\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "bedpe_output": {
          "type": "boolean",
          "description": "Write output in BEDPE format when using BAM input.\n\n**Usage:** Only applies when using BAM input (--bam_input)\n**Default:** BAM output when BAM input is used\n**Effect:** Converts BAM pairs to BEDPE format in output\n**Applications:** When you need text-based output from BAM input\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "overlap options": {
      "title": "Overlap Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "min_overlap": {
          "type": "number",
          "description": "Minimum overlap required as fraction of BEDPE intervals.\n\n**Default:** 1E-9 (effectively 1 base pair)\n**Range:** 0.0 to 1.0\n**Usage:** Overlap must be at least this fraction of the BEDPE interval\n**Example:** 0.5 requires 50% overlap\n",
          "help_text": "Type: `double`, multiple: `False`, example: `0.1`. "
        },
        "type": {
          "type": "string",
          "description": "Approach for reporting overlaps between BEDPE and BED.\n\n**either:** Report if either end of BEDPE overlaps BED (default)\n**neither:** Report if neither end of BEDPE overlaps BED\n**both:** Report if both ends of BEDPE overlap BED\n**xor:** Report if exactly one end of BEDPE overlaps BED\n**notboth:** Report if neither or exactly one end overlaps (xor + neither)\n**ispan:** Report overlaps between [end1, start2] span of BEDPE and BED\n**ospan:** Report overlaps between [start1, end2] span of BEDPE and BED\n**notispan:** Report if ispan doesn't overlap BED\n**notospan:** Report if ospan doesn't overlap BED\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"either\"`, example: `\"both\"`, choices: ``either`, `neither`, `both`, `xor`, `notboth`, `ispan`, `ospan`, `notispan`, `notospan``. ",
          "enum": [
            "either",
            "neither",
            "both",
            "xor",
            "notboth",
            "ispan",
            "ospan",
            "notispan",
            "notospan"
          ],
          "default": "either"
        }
      }
    },
    "strand options": {
      "title": "Strand Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "same_strand": {
          "type": "boolean",
          "description": "Require same strandedness when finding overlaps.\n\n**Default:** Ignore strand information\n**Usage:** Only report overlaps on the same strand\n**Note:** Not applicable with ispan, ospan, notispan, or notospan types\n**Applications:** Strand-specific analyses\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "opposite_strand": {
          "type": "boolean",
          "description": "Require different strandedness when finding overlaps.\n\n**Default:** Ignore strand information\n**Usage:** Only report overlaps on opposite strands\n**Note:** Not applicable with ispan, ospan, notispan, or notospan types\n**Applications:** Antisense interaction analyses\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "bam-specific options": {
      "title": "BAM-specific Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "edit_distance": {
          "type": "boolean",
          "description": "Use BAM total edit distance (NM tag) for BEDPE score.\n\n**Default:** Use minimum mapping quality of the two mates as score\n**Usage:** Only applies when using BAM input (--bam_input)\n**Effect:** Reports total edit distance from both mates as the score\n**Applications:** Quality assessment based on sequence accuracy\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/output options"
    },
    {
      "$ref": "#/$defs/overlap options"
    },
    {
      "$ref": "#/$defs/strand options"
    },
    {
      "$ref": "#/$defs/bam-specific options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
