比對工具之 BWA 使用方法


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使用步驟:

  1. 使用BWA構建參考基因組的index數據庫
  2. 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’.

 

注意:我們暫時還沒有使用到對比對結果有影響的參數,目前所有的參數都是固定的。

 

參考資料:

BWA官方網站

NGS生物信息分析 V4.2

Manual Reference Pages  - bwa (1)

BWA參考手冊(翻譯)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM