BWA is a software package for mapping low-divergent sequences against a large reference genome.

Command & Options:

build index

Before alignment, the FM-index needs to be constructed for the reference genome.

  • Options

    1. -p STR Prefix of the output database [same as db filename]
    2. -a [is|bwtsw] # Algorithm for constructing BWT index.
    3. is # IS is the default algorithm. IS is moderately fast, but does not work with database larger than 2GB.
    4. bwtsw # Bwtsw works with larger genomic database, such as the human genome.

    bwa mem

    map to more than one contig

  • Options

    1. -t <INT> # Number of threads
    2. -M # Mark shorter split hits as secondary (for Picard compatibility).
    3. -p

    If mates.fq file is absent and option -p is not set, this command regards input reads are single-end. If mates.fq is present, this command assumes the i-th read in reads.fq _and the i-th read in mates.fq constitute a read pair (pair-end) . If -p is used, the command assumes the 2i-th and the (2i+1)-th read in reads.fq_ constitute a read pair (such input file is said to be interleaved). In this case, mates.fq is ignored.

    Pipeline

    1. $ bwa index Wuhan-Hu-1.fasta

    Mapping sequence (BWA) - 图1

  1. $ bwa mem -t 4 -M ~/SARS_CoV_2/mapping/ref/Wuhan-Hu-1.fasta \
  2. ~/SARS_CoV_2/clean_data/P3-VERO-P3-1-vero_L4_1.fq.gz \
  3. ~/SARS_CoV_2/clean_data/P3-VERO-P3-1-vero_L4_2.fq.gz \
  4. > ~/SARS_CoV_2/mapping/P3-VERO-P3-1-vero_L4.sam \
  5. 2> ~/SARS_CoV_2/mapping/bwa_1.log

Mapping sequence (BWA) - 图2

More information:

http://bio-bwa.sourceforge.net/bwa.shtml
https://github.com/lh3/bwa