{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bedtools_bamtofastq",
  "description": "Convert BAM alignments to FASTQ files.\n\nThis tool extracts FASTQ records from sequence alignments in BAM format,\nsupporting both single-end and paired-end data extraction.\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input BAM file to be converted to FASTQ.\n\n**Requirements:**\n- Must be in BAM format\n- For paired-end output, should be sorted by query name\n",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"input.bam\"`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "fastq": {
          "type": "string",
          "format": "path",
          "description": "Output FASTQ file for single-end data or first mate in paired-end data.\n\n**Output format:** Standard FASTQ format with sequence and quality scores\n",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.fastq.fastq\"`, direction: `output`, example: `\"output.fastq\"`. ",
          "default": "$id.$key.fastq.fastq"
        },
        "fastq2": {
          "type": "string",
          "format": "path",
          "description": "Output FASTQ file for second mate in paired-end data.\n\n**Usage:**\n- Required only for paired-end BAM files\n- BAM should be sorted by query name for proper pairing\n- If omitted, only first mates or single-end reads are extracted\n",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.fastq2.fastq\"`, direction: `output`, example: `\"output_R2.fastq\"`. ",
          "default": "$id.$key.fastq2.fastq"
        }
      }
    },
    "options": {
      "title": "Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "tags": {
          "type": "boolean",
          "description": "Create FASTQ based on mate information in BAM R2 and Q2 tags.\n\n**Usage:**\n- Uses R2 tag for second mate sequence\n- Uses Q2 tag for second mate quality scores\n- Alternative to requiring coordinate-sorted paired BAM\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/options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
