name: bwa_sampe
namespace: bwa
description: BWA sampe - generate paired-end alignment in SAM format from BWA aln SAI files.
keywords: [alignment, BWA, BWA-sampe, SAM, paired-end]
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: "--sai1"
    type: file
    description: Input SAI file for first reads (R1) generated by BWA aln.
    required: true
    example: reads1.sai
  - name: "--sai2"
    type: file
    description: Input SAI file for second reads (R2) generated by BWA aln.
    required: true
    example: reads2.sai
  - name: "--reads1"
    type: file
    description: Input FASTQ file with first reads in pair (R1).
    required: true
    example: reads_R1.fastq
  - name: "--reads2"
    type: file
    description: Input FASTQ file with second reads in pair (R2).
    required: true
    example: reads_R2.fastq

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

- name: "Pairing Options"
  arguments: 
  - name: "--max_insert_size"
    alternatives: [-a]
    type: integer
    description: Maximum insert size. Default is 500.
    example: 500
  - name: "--max_occ_one_end"
    alternatives: [-o]
    type: integer
    description: Maximum occurrences for one end. Default is 100000.
    example: 100000
  - name: "--max_hits_paired"
    alternatives: [-n]
    type: integer
    description: Maximum hits to output for paired reads. Default is 3.
    example: 3
  - name: "--max_hits_discordant"
    alternatives: [-N]
    type: integer
    description: Maximum hits to output for discordant pairs. Default is 10.
    example: 10
  - name: "--chimeric_rate"
    alternatives: [-c]
    type: double
    description: Prior of chimeric rate (lower bound). Default is 1.0e-05.
    example: 0.00001

- name: "Algorithm Options"
  arguments:
  - name: "--read_group"
    alternatives: [-r]
    type: string
    description: Read group header line such as '@RG\tID:foo\tSM:bar'.
    example: "@RG\\tID:sample1\\tSM:sample1"
  - name: "--preload_index"
    alternatives: [-P]
    type: boolean_true
    description: Preload index into memory (for base-space reads only).
  - name: "--disable_smith_waterman"
    alternatives: [-s]
    type: boolean_true
    description: Disable Smith-Waterman for the unmapped mate.
  - name: "--disable_insert_size_estimate"
    alternatives: [-A]
    type: boolean_true
    description: Disable insert size estimate (force -s).

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
