The use of BWA requires twoinput File:
Reference genome data (fasta format. FA,. Fasta,. Fna)
Short reads data (fastaq format. Fastaq,. Fq)
Step 1: Establish Index
Create Index File According to reference genome data (e.g. REFERENCE.FA)
BWA index-a bwtsw reference.fa
BWA the index directive for more usage and options, use the following command to view
BWA Index
Step 2: Find SA coordinates
If it is pair-end data (LEFTREAD.FASTQ and RIGHTREAD.FASTQ) two files are processed separately
BWA AlN reference.fa leftread.fastq > Leftread.sai
BWA AlN reference.fa rightread.fastq > Rightread.sai
BWA AlN reference.fa singleread.fastq > Singleread.sai
If you want to run multi-threaded, in which the-t parameter is added, and the-f parameter can specify the result output file, such as:
BWA aln-c-t 3-f leftreads.sai reference.fa LEFTREADS.FASTQ
Step 3: Convert SA coordinates output to Sam
If it's pair-end data
BWA sampe-f pair-end.sam reference.fa leftread.sai rightread.sai leftread.fastq rightread.fastq
If it is a single reads data
BWA samse-f single.sam reference.fa single.sai single.fastq
Other :
FAI is an index of the ref genome file, allowing software to quickly and randomly read genomic sequences
Sai is the file that will be FASTQ, used for the final output than the results of the SAM file
Official documents
Http://www.bbioo.com/lifesciences/40-113315-1.html
Http://bio-bwa.sourceforge.net/bwa.shtml
Turn: How to use BWA