{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_igv",
  "description": "Create IGV batch script to generate automated screenshots of genomic regions.\n\nThis tool generates a batch script that can be run within IGV (Integrative Genomics Viewer)\nto automatically create image snapshots at each interval defined in a BED/GFF/VCF file.\nUseful for creating automated visualizations of genomic features or regions of interest.\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input file with genomic intervals for visualization.\n\n**Format:** BED, GFF, or VCF file with genomic regions\n**Usage:** Each interval will generate one IGV screenshot\n**Column 4:** Optional name field used for image filenames (with --use_name)\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 IGV batch script file.\n\n**Format:** Plain text script with IGV commands\n**Usage:** Run this script within IGV to generate automated screenshots\n**Extension:** Typically .txt or .igv\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.txt\"`, direction: `output`, example: `\"igv_batch_script.txt\"`. ",
          "default": "$id.$key.output.txt"
        }
      }
    },
    "output configuration": {
      "title": "Output Configuration",
      "type": "object",
      "description": "No description",
      "properties": {
        "output_path": {
          "type": "string",
          "description": "Full path where IGV snapshots should be written.\n\n**Format:** Directory path (must exist before running script)\n**Default:** Current directory (./)\n**Example:** \"/path/to/igv/images/\"\n**Note:** Include trailing slash for directories\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"./igv_images/\"`. "
        },
        "image_format": {
          "type": "string",
          "description": "Image format for generated screenshots.\n\n**Options:** png, eps, svg\n**Default:** png\n**Recommendation:** PNG for most use cases\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"png\"`, choices: ``png`, `eps`, `svg``. ",
          "enum": [
            "png",
            "eps",
            "svg"
          ]
        }
      }
    },
    "igv session options": {
      "title": "IGV Session Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "session_file": {
          "type": "string",
          "format": "path",
          "description": "Path to existing IGV session file to load before taking snapshots.\n\n**Format:** IGV session file (.xml)\n**Purpose:** Pre-loads genome, tracks, and display settings\n**Optional:** If not provided, assumes genome and tracks are already loaded\n",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"my_analysis.xml\"`. "
        }
      }
    },
    "display options": {
      "title": "Display Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "sort_reads": {
          "type": "string",
          "description": "BAM read sorting method to apply for each image.\n\n**Options:** base, position, strand, quality, sample, readGroup\n**Default:** No sorting applied\n**Usage:** Only relevant when BAM tracks are loaded in IGV\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"position\"`, choices: ``base`, `position`, `strand`, `quality`, `sample`, `readGroup``. ",
          "enum": [
            "base",
            "position",
            "strand",
            "quality",
            "sample",
            "readGroup"
          ]
        },
        "collapse_reads": {
          "type": "boolean",
          "description": "Collapse aligned reads before taking snapshots.\n\n**Effect:** Shows read coverage instead of individual reads\n**Usage:** Useful for high-coverage regions\n**Default:** false (show individual reads)\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "flank_size": {
          "type": "integer",
          "description": "Number of flanking base pairs on left and right of each region.\n\n**Range:** 0 or positive integer\n**Default:** 0 (no flanking)\n**Purpose:** Include context around regions of interest\n**Example:** 1000 adds 1kb padding on each side\n",
          "help_text": "Type: `integer`, multiple: `False`, example: `1000`. "
        },
        "use_name": {
          "type": "boolean",
          "description": "Use the name field (column 4) from input file for image filenames.\n\n**Effect:** Images named using BED name field instead of coordinates\n**Default:** false (use \"chr:start-end.ext\" format)\n**Requirement:** Input file must have name field (column 4)\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 configuration"
    },
    {
      "$ref": "#/$defs/igv session options"
    },
    {
      "$ref": "#/$defs/display options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
