BWA_MEM(1)

NAME
bwa_mem.pl - Align a set of lanes to specified reference with single command.

SYNOPSIS
bwa_mem.pl [options] [file(s)...]

  Required parameters:
    -outdir      -o   Folder to output result to.
    -reference   -r   Path to reference genome file *.fa[.gz]
    -sample      -s   Sample name to be applied to output file.
    -threads     -t   Number of threads to use. [1]

  Optional parameters:
    -fragment    -f   Split input into fragements of X million repairs [10]
    -nomarkdup   -n   Don't mark duplicates
    -cram        -c   Output cram, see '-sc'
    -scramble    -sc  Single quoted string of parameters to pass to Scramble when '-c' used
                      - '-I,-O' are used internally and should not be provided
    -bwa         -b     Single quoted string of additional parameters to pass to BWA
                         - '-t,-p,-R' are used internally and should not be provided
    -map_threads -mt  Number of cores applied to each parallel BWA job when '-t' exceeds this value and '-i' is not in use[6]

  Targeted processing:
    -process     -p   Only process this step then exit, optionally set -index
                        bwamem - only applicable if input is bam
                          mark - Run duplicate marking (-index N/A)
                         stats - Generates the *.bas file for the final BAM.

    -index       -i   Optionally restrict '-p' to single job
                        bwamem - 1..<lane_count>

  Performance variables
    -bwa_pl      -l   BWA runs ~8% quicker when using the tcmalloc library from
                      https://github.com/gperftools/ (assuming number of cores not exceeded)
                      If available specify the path to 'gperftools/lib/libtcmalloc_minimal.so'.

  Other:
    -jobs        -j   For a parallel step report the number of jobs required
    -help        -h   Brief help message.
    -man         -m   Full documentation.

File list can be full file names or wildcard, e.g.

mutiple BAM inputs
     bwa_mem.pl -t 16 -r some/genome.fa.gz -o myout -s sample input/*.bam

multiple paired fastq inputs
     bwa_mem.pl -t 16 -r some/genome.fa.gz -o myout -s sample input/*_[12].fq[.gz]

multiple interleaved paired fastq inputs
     bwa_mem.pl -t 16 -r some/genome.fa.gz -o myout -s sample input/*.fq[.gz]

mixture of BAM and CRAM
     bwa_mem.pl -t 16 -r some/genome.fa.gz -o myout -s sample input/*.bam input/*.cram

DESCRIPTION
bwa_mem.pl will attempt to run all mapping steps for BWA-mem, as well as subsequent merging and duplicate marking automatically.

OPTION DETAILS

-outdir
    Directory to write output to. During processing a temp folder will be generated in this area, should the process fail only delete this if you are unable to resume the process.

    Final output files include: <SAMPLE>.bam, <SAMPLE>.bam.bai, <SAMPLE>.md5, <SAMPLE>.met

-reference
    Path to genome.fa[.gz] file and associated indexes for BWA.

-sample
    Name to be applied to output files. Special characters will not be magically fixed.

-threads
    Number of threads to be used in processing.

    If perl is not compiled with threading some steps will not run in parallel, however much of the script calls other tools that will still utilise this appropriately.

  TARGETED PROCESSING

-process
    If you want to run the code in a more efficient manner then this allows each procesing type to be executed in isolation. You can restrict to a single process within the block by specifying -index as well.

  INPUT FILE TYPES
There are several types of file that the script is able to process.

f[ast]q
    A standard uncompressed fastq file. Requires a pair of inputs with standard suffix of '_1' and '_2' immediately prior to '.f[ast]q' or an interleaved f[ast]q file where read 1 and 2 are adjacent in the file.

f[ast]q.gz
    As *.f[ast]q but compressed with gzip.

bam Single lane BAM files, RG line is transfered to aligned files. Also accepts multi lane BAM.

cram
    Single lane BAM files, RG line is transfered to aligned files. Also accepts multi lane CRAM.