name: bwa_mem
description: Performs fastq alignment to a fasta reference using BWA
keywords:
  - mem
  - bwa
  - alignment
  - map
  - fastq
  - bam
  - sam
tools:
  - bwa:
      description: |
        BWA is a software package for mapping DNA sequences against
        a large reference genome, such as the human genome.
      homepage: http://bio-bwa.sourceforge.net/
      documentation: https://bio-bwa.sourceforge.net/bwa.shtml
      arxiv: arXiv:1303.3997
      licence: ["GPL-3.0-or-later"]
      identifier: ""
input:
  - - meta:
        type: map
        description: |
          Groovy Map containing sample information
          e.g. [ id:'test', single_end:false ]
    - reads:
        type: file
        description: |
          List of input FastQ files of size 1 and 2 for single-end and paired-end data,
          respectively.
  - - meta2:
        type: map
        description: |
          Groovy Map containing reference information.
          e.g. [ id:'test', single_end:false ]
    - index:
        type: file
        description: BWA genome index files
        pattern: "Directory containing BWA index *.{amb,ann,bwt,pac,sa}"
  - - meta3:
        type: map
        description: |
          Groovy Map containing sample information
          e.g. [ id:'test', single_end:false ]
    - fasta:
        type: file
        description: Reference genome in FASTA format
        pattern: "*.{fasta,fa}"
  - - sort_bam:
        type: boolean
        description: use samtools sort (true) or samtools view (false)
        pattern: "true or false"
output:
  - bam:
      - meta:
          type: file
          description: Output BAM file containing read alignments
          pattern: "*.{bam}"
      - "*.bam":
          type: file
          description: Output BAM file containing read alignments
          pattern: "*.{bam}"
  - cram:
      - meta:
          type: file
          description: Output CRAM file containing read alignments
          pattern: "*.{cram}"
      - "*.cram":
          type: file
          description: Output CRAM file containing read alignments
          pattern: "*.{cram}"
  - csi:
      - meta:
          type: file
          description: Optional index file for BAM file
          pattern: "*.{csi}"
      - "*.csi":
          type: file
          description: Optional index file for BAM file
          pattern: "*.{csi}"
  - crai:
      - meta:
          type: file
          description: Optional index file for CRAM file
          pattern: "*.{crai}"
      - "*.crai":
          type: file
          description: Optional index file for CRAM file
          pattern: "*.{crai}"
  - versions:
      - versions.yml:
          type: file
          description: File containing software versions
          pattern: "versions.yml"
authors:
  - "@drpatelh"
  - "@jeremy1805"
  - "@matthdsm"
maintainers:
  - "@drpatelh"
  - "@jeremy1805"
  - "@matthdsm"
