{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_intersect",
  "description": "Find overlaps between genomic features from two sets of intervals.\n\nbedtools intersect allows one to screen for overlaps between two sets of genomic features. \nMoreover, it allows one to have fine control as to how the intersections are reported. \nbedtools intersect works with both BED/GFF/VCF and BAM files as input.\n",
  "type": "object",
  "$defs": {
    "input arguments": {
      "title": "Input arguments",
      "type": "object",
      "description": "No description",
      "properties": {
        "input_a": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "The input file (BED/GFF/VCF/BAM) to be used as the -a file.\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`. "
        },
        "input_b": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "exists": true,
          "description": "The input file(s) (BED/GFF/VCF/BAM) to be used as the -b file(s).\n",
          "help_text": "Type: `file`, multiple: `True`, required, direction: `input`. "
        }
      }
    },
    "output arguments": {
      "title": "Output arguments",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "The output BED file.\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output\"`, direction: `output`. ",
          "default": "$id.$key.output"
        }
      }
    },
    "output format options": {
      "title": "Output format options",
      "type": "object",
      "description": "No description",
      "properties": {
        "write_a": {
          "type": "boolean",
          "description": "Write the original A entry for each overlap",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "write_b": {
          "type": "boolean",
          "description": "Write the original B entry for each overlap",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "left_outer_join": {
          "type": "boolean",
          "description": "Perform a \"left outer join\"",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "write_overlap": {
          "type": "boolean",
          "description": "Write the original A and B entries plus the number of base pairs of overlap between the two features.\nOverlaps restricted by -f and -r",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "write_overlap_plus": {
          "type": "boolean",
          "description": "Write the original A and B entries plus the number of base pairs of overlap between the two features.\nOverlaps restricted by -f and -r",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "report_A_if_no_overlap": {
          "type": "boolean",
          "description": "Write the original A entry _if_ no overlap is found",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "number_of_overlaps_A": {
          "type": "boolean",
          "description": "For each entry in A, report the number of overlaps with B.\nReports 0 for A entries that have no overlap with B.\nOverlaps restricted by -f and -r.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "report_no_overlaps_A": {
          "type": "boolean",
          "description": "Only report those entries in A that have _no overlaps_ with B.\nSimilar to \"grep -v\" (an homage).\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "uncompressed_bam": {
          "type": "boolean",
          "description": "Write uncompressed BAM output",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "filtering options": {
      "title": "Filtering options",
      "type": "object",
      "description": "No description",
      "properties": {
        "same_strand": {
          "type": "boolean",
          "description": "Require same strandedness",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "opposite_strand": {
          "type": "boolean",
          "description": "Require different strandedness",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "min_overlap_A": {
          "type": "number",
          "description": "Minimum overlap required as a fraction of A.\nDefault is 1E-9 (i.e., 1bp).\n",
          "help_text": "Type: `double`, multiple: `False`. "
        },
        "min_overlap_B": {
          "type": "number",
          "description": "Minimum overlap required as a fraction of B.\nDefault is 1E-9 (i.e., 1bp).\n",
          "help_text": "Type: `double`, multiple: `False`. "
        },
        "reciprocal_overlap": {
          "type": "boolean",
          "description": "Require that the fraction overlap be reciprocal for A AND B.\n- In other words, if -f is 0.90 and -r is used, this requires\nthat B overlap 90% of A and A _also_ overlaps 90% of B.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "either_overlap": {
          "type": "boolean",
          "description": "Require that the minimum fraction be satisfied for A OR B.\n- In other words, if -e is used with -f 0.90 and -F 0.10 this requires\nthat either 90% of A is covered OR 10% of B is covered.\nWithout -e, both fractions would have to be satisfied.\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.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "genome": {
          "type": "string",
          "format": "path",
          "description": "Provide a genome file to enforce consistent chromosome \nsort order across input files",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"genome.txt\"`. "
        },
        "nonamecheck": {
          "type": "boolean",
          "description": "For sorted data, don't throw an error if the file \nhas different naming conventions for the same chromosome \n(e.g., \"chr1\" vs \"chr01\").\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "sorted": {
          "type": "boolean",
          "description": "Use the \"chromsweep\" algorithm for sorted (-k1,1 -k2,2n) input.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "names": {
          "type": "string",
          "description": "When using multiple databases, provide an alias \nfor each that will appear instead of a fileId when \nalso printing the DB record.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "filenames": {
          "type": "boolean",
          "description": "When using multiple databases, show each complete filename instead of a fileId when also printing the DB record.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "sortout": {
          "type": "boolean",
          "description": "When using multiple databases, sort the output DB hits for each record.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "bed": {
          "type": "boolean",
          "description": "If using BAM input, write output as BED.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "header": {
          "type": "boolean",
          "description": "Print the header from the A file prior to results.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_buffer_output": {
          "type": "boolean",
          "description": "Disable buffered output",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "io_buffer_size": {
          "type": "integer",
          "description": "Specify amount of memory to use for input buffer.\nTakes an integer argument",
          "help_text": "Type: `integer`, multiple: `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/input arguments"
    },
    {
      "$ref": "#/$defs/output arguments"
    },
    {
      "$ref": "#/$defs/output format options"
    },
    {
      "$ref": "#/$defs/filtering options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
