name: bwa_aln
namespace: bwa
description: BWA aln algorithm for aligning short sequence reads to a reference genome.
keywords: [alignment, BWA, BWA-aln, mapping, short-reads]
links:
  homepage: https://bio-bwa.sourceforge.net/
  documentation: https://bio-bwa.sourceforge.net/bwa.shtml
  repository: https://github.com/lh3/bwa
license: MIT
requirements:
  commands: [bwa]
authors:
  - __merge__: /src/_authors/robrecht_cannoodt.yaml
    roles: [ author, maintainer ]
  - __merge__: /src/_authors/toni_verbeiren.yaml
    roles: [ reviewer ]

argument_groups: 
- name: "Input"
  arguments: 
  - name: "--index"
    type: file
    description: BWA index base name (prefix of .amb, .ann, .bwt, .pac, .sa files).
    required: true
    example: reference.fasta
  - name: "--reads"
    type: file
    description: Input FASTQ file with reads to align.
    required: true
    example: reads.fastq

- name: "Output"
  arguments: 
  - name: "--output"
    alternatives: [-f]
    type: file
    direction: output
    description: Output SAI file. If not specified, output goes to stdout.
    example: output.sai

- name: "Algorithm Options"
  arguments: 
  - name: "--max_diff"
    alternatives: [-n]
    type: string
    description: "Max #diff (int) or missing prob under 0.02 err rate (float). Default is 0.04."
    example: "0.04"
  - name: "--max_gap_opens"
    alternatives: [-o]
    type: integer
    description: Maximum number or fraction of gap opens. Default is 1.
    example: 1
  - name: "--max_gap_extensions"
    alternatives: [-e]
    type: integer
    description: Maximum number of gap extensions, -1 for disabling long gaps. Default is -1.
    example: -1
  - name: "--indel_end_skip"
    alternatives: [-i]
    type: integer
    description: Do not put an indel within INT bp towards the ends. Default is 5.
    example: 5
  - name: "--max_long_deletion_extensions"
    alternatives: [-d]
    type: integer
    description: Maximum occurrences for extending a long deletion. Default is 10.
    example: 10
  - name: "--seed_length"
    alternatives: [-l]
    type: integer
    description: Seed length. Default is 32.
    example: 32
  - name: "--max_seed_diff"
    alternatives: [-k]
    type: integer
    description: Maximum differences in the seed. Default is 2.
    example: 2
  - name: "--max_queue_entries"
    alternatives: [-m]
    type: integer
    description: Maximum entries in the queue. Default is 2000000.
    example: 2000000

- name: "Scoring Options"
  arguments: 
  - name: "--mismatch_penalty"
    alternatives: [-M]
    type: integer
    description: Mismatch penalty. Default is 3.
    example: 3
  - name: "--gap_open_penalty"
    alternatives: [-O]
    type: integer
    description: Gap open penalty. Default is 11.
    example: 11
  - name: "--gap_extension_penalty"
    alternatives: [-E]
    type: integer
    description: Gap extension penalty. Default is 4.
    example: 4
  - name: "--stop_search_threshold"
    alternatives: [-R]
    type: integer
    description: Stop searching when there are >INT equally best hits. Default is 30.
    example: 30
  - name: "--quality_threshold"
    alternatives: [-q]
    type: integer
    description: Quality threshold for read trimming down to 35bp. Default is 0.
    example: 0

- name: "Input/Output Options"
  arguments: 
  - name: "--barcode_length"
    alternatives: [-B]
    type: integer
    description: Length of barcode.
    example: 10
  - name: "--log_gap_penalty"
    alternatives: [-L]
    type: boolean_true
    description: Log-scaled gap penalty for long deletions.
  - name: "--non_iterative"
    alternatives: [-N]
    type: boolean_true
    description: Non-iterative mode - search for all n-difference hits (slow).
  - name: "--illumina_13_format"
    alternatives: [-I]
    type: boolean_true
    description: The input is in the Illumina 1.3+ FASTQ-like format.
  - name: "--input_bam"
    alternatives: [-b]
    type: boolean_true
    description: The input read file is in the BAM format.
  - name: "--single_end_only"
    alternatives: ["-0"]
    type: boolean_true
    description: Use single-end reads only (effective with -b).
  - name: "--use_first_read"
    alternatives: ["-1"]
    type: boolean_true
    description: Use the 1st read in a pair (effective with -b).
  - name: "--use_second_read"
    alternatives: ["-2"]
    type: boolean_true
    description: Use the 2nd read in a pair (effective with -b).
  - name: "--filter_casava"
    alternatives: [-Y]
    type: boolean_true
    description: Filter Casava-filtered sequences.

resources:
  - type: bash_script
    path: script.sh
  - type: file
    path: help.txt

test_resources:
  - type: bash_script
    path: test.sh
  - path: /src/_utils/test_helpers.sh

engines:
- type: docker
  image: quay.io/biocontainers/bwa:0.7.19--h577a1d6_1
  setup:
    - type: docker
      run: |
        bwa 2>&1 | grep "Version:" | sed 's/Version: /bwa: /' > /var/software_versions.txt

runners:
- type: executable
- type: nextflow
