比对工具之 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参考手册(翻译)

posted @   Life·Intelligence  阅读(20273)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
TOP
点击右上角即可分享
微信分享提示