BWA算法簡介:
- BWA-bactrack
- BWA-SW
- BWA-MEM
BWA安裝:
# installing BWA tar jxf ~/software/bwa-0.7.10.tar.bz2 -C /opt/biosoft/ cd /opt/biosoft/bwa-0.7.10/ make echo 'PATH=$PATH:/opt/biosoft/bwa-0.7.10' >> ~/.bashrc source ~/.bashrc
BWA使用步驟:
- 使用BWA構建參考基因組的index數據庫
- BWA-MEM比對(BWA-SW 和 BWA-backtrack用的少)
具體命令:
# 創建運行目錄並進入 mkdir -p ~/train/05.reads_aligment/bwa cd 05.reads_aligment/bwa/ # 為原始數據創建軟鏈接,方便數據處理 ln -s ~/data/00.incipient_data/data_for_gene_prediction_and_RNA-seq/genome.fasta ln -s ~/data/00.incipient_data/data_for_variants_calling/F2-19.?.fastq ./ # 創建參考基因組的索引 bwa index genome.fasta -p genome # 比對創建sam文件 bwa mem -t 4 genome F2-19.1.fastq F2-19.2.fastq > F2-19.mem.sam
核心命令及其參數
bwa index $ref bwa mem -t $NP -M -R "@RG\tID:$sample\tLB:$sample\tSM:$sample\tPL:illumina\tPU:$sample" $ref $fq1 $fq2 > $out/bwamem_$sample.sam -t # INT Number of threads -f # 沒找到 -M # Mark shorter split hits as secondary(為了Picard兼容性) -R # Complete read group header line. ’\t’ can be used in STR and will be converted to a TAB in the output SAM. The read group ID will be attached to every read in the output. An example is ’@RG\tID:foo\tSM:bar’.
注意:我們暫時還沒有使用到對比對結果有影響的參數,目前所有的參數都是固定的。
參考資料:
NGS生物信息分析 V4.2
Manual Reference Pages - bwa (1)
BWA參考手冊(翻譯)