{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "bowtie2_align",
  "description": "Align single-end and paired-end reads to a reference genome using Bowtie2.\n\nBowtie2 is an ultrafast and memory-efficient tool for aligning sequencing reads\nto long reference sequences. It is particularly good at aligning reads of about\n50 up to 100s of characters, and particularly good at aligning to relatively\nlong (e.g. mammalian) genomes.\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "index": {
          "type": "string",
          "description": "Index filename prefix (minus trailing .X.bt2).",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"genome_index\"`. "
        },
        "mate1": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "description": "Files with #1 mates, paired with files in --mate2.",
          "help_text": "Type: `file`, multiple: `True`, direction: `input`, example: `[\"reads_R1.fastq.gz\"]`. "
        },
        "mate2": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "description": "Files with #2 mates, paired with files in --mate1.",
          "help_text": "Type: `file`, multiple: `True`, direction: `input`, example: `[\"reads_R2.fastq.gz\"]`. "
        },
        "unpaired": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "description": "Files with unpaired reads.",
          "help_text": "Type: `file`, multiple: `True`, direction: `input`, example: `[\"reads.fastq.gz\"]`. "
        },
        "interleaved": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "description": "Files with interleaved paired-end FASTQ/FASTA reads.",
          "help_text": "Type: `file`, multiple: `True`, direction: `input`, example: `[\"interleaved.fastq.gz\"]`. "
        },
        "bam_input": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "format": "path",
          "description": "Files are unaligned BAM sorted by read name.",
          "help_text": "Type: `file`, multiple: `True`, direction: `input`, example: `[\"unaligned.bam\"]`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "File for SAM output (default stdout).",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.sam\"`, direction: `output`, example: `\"aligned.sam\"`. ",
          "default": "$id.$key.output.sam"
        },
        "un": {
          "type": "string",
          "format": "path",
          "description": "Write unpaired reads that didn't align to file.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.un.fastq\"`, direction: `output`, example: `\"unaligned.fastq\"`. ",
          "default": "$id.$key.un.fastq"
        },
        "al": {
          "type": "string",
          "format": "path",
          "description": "Write unpaired reads that aligned at least once to file.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.al.fastq\"`, direction: `output`, example: `\"aligned.fastq\"`. ",
          "default": "$id.$key.al.fastq"
        },
        "un_conc": {
          "type": "string",
          "format": "path",
          "description": "Write pairs that didn't align concordantly to file.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.un_conc.fastq\"`, direction: `output`, example: `\"unaligned_pairs.fastq\"`. ",
          "default": "$id.$key.un_conc.fastq"
        },
        "al_conc": {
          "type": "string",
          "format": "path",
          "description": "Write pairs that aligned concordantly at least once to file.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.al_conc.fastq\"`, direction: `output`, example: `\"aligned_pairs.fastq\"`. ",
          "default": "$id.$key.al_conc.fastq"
        },
        "met_file": {
          "type": "string",
          "format": "path",
          "description": "Send metrics to file.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.met_file.txt\"`, direction: `output`, example: `\"metrics.txt\"`. ",
          "default": "$id.$key.met_file.txt"
        }
      }
    },
    "input format options": {
      "title": "Input Format Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "fastq": {
          "type": "boolean",
          "description": "Query input files are FASTQ .fq/.fastq (default).",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "tab5": {
          "type": "boolean",
          "description": "Query input files are TAB5 .tab5.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "tab6": {
          "type": "boolean",
          "description": "Query input files are TAB6 .tab6.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "qseq": {
          "type": "boolean",
          "description": "Query input files are in Illumina's qseq format.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "fasta": {
          "type": "boolean",
          "description": "Query input files are (multi-)FASTA .fa/.mfa.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "raw": {
          "type": "boolean",
          "description": "Query input files are raw one-sequence-per-line.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "cmdline": {
          "type": "boolean",
          "description": "<m1>, <m2>, <r> are sequences themselves, not files.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "skip": {
          "type": "integer",
          "description": "Skip the first <int> reads/pairs in the input.",
          "help_text": "Type: `integer`, multiple: `False`, example: `1000`. "
        },
        "upto": {
          "type": "integer",
          "description": "Stop after first <int> reads/pairs.",
          "help_text": "Type: `integer`, multiple: `False`, example: `10000`. "
        },
        "trim5": {
          "type": "integer",
          "description": "Trim <int> bases from 5'/left end of reads.",
          "help_text": "Type: `integer`, multiple: `False`, example: `5`. "
        },
        "trim3": {
          "type": "integer",
          "description": "Trim <int> bases from 3'/right end of reads.",
          "help_text": "Type: `integer`, multiple: `False`, example: `3`. "
        },
        "trim_to": {
          "type": "string",
          "description": "Trim reads exceeding <int> bases from either 3' or 5' end",
          "help_text": "Type: `string`, multiple: `False`, example: `\"3:100\"`. "
        },
        "continuous_fasta": {
          "type": "string",
          "description": "Query input files are continuous FASTA where reads are k-mers",
          "help_text": "Type: `string`, multiple: `False`, example: `\"k:25,i:1\"`. "
        },
        "phred33": {
          "type": "boolean",
          "description": "Qualities are Phred+33 (default).",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "phred64": {
          "type": "boolean",
          "description": "Qualities are Phred+64.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "int_quals": {
          "type": "boolean",
          "description": "Qualities encoded as space-delimited integers.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "alignment presets": {
      "title": "Alignment Presets",
      "type": "object",
      "description": "No description",
      "properties": {
        "very_fast": {
          "type": "boolean",
          "description": "Same as -D 5 -R 1 -N 0 -L 22 -i S,0,2.50.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "fast": {
          "type": "boolean",
          "description": "Same as -D 10 -R 2 -N 0 -L 22 -i S,0,2.50.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "sensitive": {
          "type": "boolean",
          "description": "Same as -D 15 -R 2 -N 0 -L 22 -i S,1,1.15 (default).",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "very_sensitive": {
          "type": "boolean",
          "description": "Same as -D 20 -R 3 -N 0 -L 20 -i S,1,0.50.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "very_fast_local": {
          "type": "boolean",
          "description": "Same as -D 5 -R 1 -N 0 -L 25 -i S,1,2.00.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "fast_local": {
          "type": "boolean",
          "description": "Same as -D 10 -R 2 -N 0 -L 22 -i S,1,1.75.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "sensitive_local": {
          "type": "boolean",
          "description": "Same as -D 15 -R 2 -N 0 -L 20 -i S,1,0.75.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "very_sensitive_local": {
          "type": "boolean",
          "description": "Same as -D 20 -R 3 -N 0 -L 20 -i S,1,0.50.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "alignment options": {
      "title": "Alignment Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "N": {
          "type": "integer",
          "description": "Max # mismatches in seed alignment; can be 0 or 1.",
          "help_text": "Type: `integer`, multiple: `False`, example: `1`. "
        },
        "L": {
          "type": "integer",
          "description": "Length of seed substrings; must be >3, <32.",
          "help_text": "Type: `integer`, multiple: `False`, example: `22`. "
        },
        "i": {
          "type": "string",
          "description": "Interval between seed substrings w/r/t read len.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"S,1,1.15\"`. "
        },
        "n_ceil": {
          "type": "string",
          "description": "Function for max # non-A/C/G/Ts permitted in aln.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"L,0,0.15\"`. "
        },
        "dpad": {
          "type": "integer",
          "description": "Include <int> extra ref chars on sides of DP table.",
          "help_text": "Type: `integer`, multiple: `False`, example: `15`. "
        },
        "gbar": {
          "type": "integer",
          "description": "Disallow gaps within <int> nucs of read extremes.",
          "help_text": "Type: `integer`, multiple: `False`, example: `4`. "
        },
        "ignore_quals": {
          "type": "boolean",
          "description": "Treat all quality values as 30 on Phred scale.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "nofw": {
          "type": "boolean",
          "description": "Do not align forward (original) version of read.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "norc": {
          "type": "boolean",
          "description": "Do not align reverse-complement version of read.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_1mm_upfront": {
          "type": "boolean",
          "description": "Do not allow 1 mismatch alignments before attempting to scan for the optimal seeded alignments.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "end_to_end": {
          "type": "boolean",
          "description": "Entire read must align; no clipping (default).",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "local": {
          "type": "boolean",
          "description": "Local alignment; ends might be soft clipped.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "scoring options": {
      "title": "Scoring Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "ma": {
          "type": "integer",
          "description": "Match bonus (0 for --end-to-end, 2 for --local).",
          "help_text": "Type: `integer`, multiple: `False`, example: `2`. "
        },
        "mp": {
          "type": "string",
          "description": "Max penalty for mismatch; lower qual = lower penalty.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"6\"`. "
        },
        "np": {
          "type": "integer",
          "description": "Penalty for non-A/C/G/Ts in read/ref.",
          "help_text": "Type: `integer`, multiple: `False`, example: `1`. "
        },
        "rdg": {
          "type": "string",
          "description": "Read gap open, extend penalties.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"5,3\"`. "
        },
        "rfg": {
          "type": "string",
          "description": "Reference gap open, extend penalties.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"5,3\"`. "
        },
        "score_min": {
          "type": "string",
          "description": "Min acceptable alignment score w/r/t read length.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"L,-0.6,-0.6\"`. "
        }
      }
    },
    "reporting options": {
      "title": "Reporting Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "k": {
          "type": "integer",
          "description": "Report up to <int> alns per read; MAPQ not meaningful.",
          "help_text": "Type: `integer`, multiple: `False`, example: `10`. "
        },
        "all": {
          "type": "boolean",
          "description": "Report all alignments; very slow, MAPQ not meaningful.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "effort options": {
      "title": "Effort Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "D": {
          "type": "integer",
          "description": "Give up extending after <int> failed extends in a row.",
          "help_text": "Type: `integer`, multiple: `False`, example: `15`. "
        },
        "R": {
          "type": "integer",
          "description": "For reads w/ repetitive seeds, try <int> sets of seeds.",
          "help_text": "Type: `integer`, multiple: `False`, example: `2`. "
        }
      }
    },
    "paired-end options": {
      "title": "Paired-end Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "minins": {
          "type": "integer",
          "description": "Minimum fragment length.",
          "help_text": "Type: `integer`, multiple: `False`, example: `0`. "
        },
        "maxins": {
          "type": "integer",
          "description": "Maximum fragment length.",
          "help_text": "Type: `integer`, multiple: `False`, example: `500`. "
        },
        "fr": {
          "type": "boolean",
          "description": "-1, -2 mates align fw/rev (default).",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "rf": {
          "type": "boolean",
          "description": "-1, -2 mates align rev/fw.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "ff": {
          "type": "boolean",
          "description": "-1, -2 mates align fw/fw.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_mixed": {
          "type": "boolean",
          "description": "Suppress unpaired alignments for paired reads.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_discordant": {
          "type": "boolean",
          "description": "Suppress discordant alignments for paired reads.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "dovetail": {
          "type": "boolean",
          "description": "Concordant when mates extend past each other.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_contain": {
          "type": "boolean",
          "description": "Not concordant when one mate alignment contains other.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_overlap": {
          "type": "boolean",
          "description": "Not concordant when mates overlap at all.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "sam output options": {
      "title": "SAM Output Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "time": {
          "type": "boolean",
          "description": "Print wall-clock time taken by search phases.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "quiet": {
          "type": "boolean",
          "description": "Print nothing to stderr except serious errors.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "met_stderr": {
          "type": "boolean",
          "description": "Send metrics to stderr.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "met": {
          "type": "integer",
          "description": "Report internal counters & metrics every <int> secs.",
          "help_text": "Type: `integer`, multiple: `False`, example: `1`. "
        },
        "no_unal": {
          "type": "boolean",
          "description": "Suppress SAM records for unaligned reads.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_head": {
          "type": "boolean",
          "description": "Suppress header lines, i.e",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "no_sq": {
          "type": "boolean",
          "description": "Suppress @SQ header lines.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "rg_id": {
          "type": "string",
          "description": "Set read group id, reflected in @RG line and RG:Z: opt field.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"sample1\"`. "
        },
        "rg": {
          "type": "string",
          "description": "Add <text> (\"lab:value\") to @RG line of SAM header.",
          "help_text": "Type: `string`, multiple: `False`, example: `\"SM:sample1\"`. "
        },
        "omit_sec_seq": {
          "type": "boolean",
          "description": "Put '*' in SEQ and QUAL fields for secondary alignments.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "sam_no_qname_trunc": {
          "type": "boolean",
          "description": "Suppress standard behavior of truncating readname at first whitespace.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "xeq": {
          "type": "boolean",
          "description": "Use '='/'X', instead of 'M,' to specify matches/mismatches in SAM record.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "soft_clipped_unmapped_tlen": {
          "type": "boolean",
          "description": "Exclude soft-clipped bases when reporting TLEN.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "sam_append_comment": {
          "type": "boolean",
          "description": "Append FASTA/FASTQ comment to SAM record.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "sam_opt_config": {
          "type": "string",
          "description": "Use config to toggle SAM Optional fields",
          "help_text": "Type: `string`, multiple: `False`, example: `\"-MD,YP,-AS\"`. "
        }
      }
    },
    "bam options": {
      "title": "BAM Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "align_paired_reads": {
          "type": "boolean",
          "description": "Align paired-end reads instead of unpaired BAM reads.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "preserve_tags": {
          "type": "boolean",
          "description": "Preserve tags from the original BAM record.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "performance options": {
      "title": "Performance Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "reorder": {
          "type": "boolean",
          "description": "Force SAM output order to match order of input reads.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "mm": {
          "type": "boolean",
          "description": "Use memory-mapped I/O for index; many 'bowtie's can share.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "other options": {
      "title": "Other Options",
      "type": "object",
      "description": "No description",
      "properties": {
        "qc_filter": {
          "type": "boolean",
          "description": "Filter out reads that are bad according to QSEQ filter.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "seed": {
          "type": "integer",
          "description": "Seed for random number generator.",
          "help_text": "Type: `integer`, multiple: `False`, example: `42`. "
        },
        "non_deterministic": {
          "type": "boolean",
          "description": "Seed rand",
          "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/input format options"
    },
    {
      "$ref": "#/$defs/alignment presets"
    },
    {
      "$ref": "#/$defs/alignment options"
    },
    {
      "$ref": "#/$defs/scoring options"
    },
    {
      "$ref": "#/$defs/reporting options"
    },
    {
      "$ref": "#/$defs/effort options"
    },
    {
      "$ref": "#/$defs/paired-end options"
    },
    {
      "$ref": "#/$defs/sam output options"
    },
    {
      "$ref": "#/$defs/bam options"
    },
    {
      "$ref": "#/$defs/performance options"
    },
    {
      "$ref": "#/$defs/other options"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
