Bowtie2数据比对教程

本文详细介绍了Bowtie2在转录组数据分析中的应用,包括安装方法、索引创建、单双端测序比对步骤,以及关键参数设置。旨在帮助读者理解并实践转录组上游分析的基本流程。
摘要由CSDN通过智能技术生成

一边学习,一边总结,一边分享!

此教程原文链接:Bowtie2数据比对教程

转录组教程

1. 转录组上游分析教程[零基础(完)]


2. 一个转录组上游分析流程 | Hisat2-Stringtie

3. 转录组无参比对教程 | Trinity

写在前面

随着我们教程逐渐发布,我们转录组分析系列教程也逐渐分章节开放。若你有需要,可直接查看转录组上游分析教程[零基础(完)]

个人笔记,可能会出现一些错误!

若我们的分享对你有用,希望您可以点赞+收藏+转发,这是对小杜最大的支持。


Bowtie2和Bwa是用于短reads的比对软件,bowtie2主要用于50-1000bp的reads进行比对,生产SAM文件。在做转录组数据分析前,会过RNA-seq数据中的tRNA等序列,常常使用bowtie2进行过滤。

Bowtie2的使用手册

Bowtie 2: (https://bowtie-bio.sourceforge.net/bowtie2/manual.shtml#how-is-bowtie-2-different-from-bowtie-1)

2012年发表在Nature Methods期刊

一、bowtie2的安装

  1. 使用conda安装
conda install -y bowtie2
  1. 使用源码安装
    网址:https://sourceforge.net/projects/bowtie-bio/files/bowtie2/
# 直接下载后解压
wget https://nchc.dl.sourceforge.net/project/bowtie-bio/bowtie2/2.5.1/bowtie2-2.5.1-linux-x86_64.zip
unzip bowtie2-2.5.1-linux-x86_64.zip
cd bowtie2-2.5.1-linux-x86_64
## 配置路径即可使用
echo 'PATH=$PATH:/software/bowtie2-2.5.1-linux-x86_64' >> ~/.bashrc

参数:

$ bowtie2 -h
Bowtie 2 version 2.4.5 by Ben Langmead (langmea@cs.jhu.edu, www.cs.jhu.edu/~langmea)
Usage: 
  bowtie2 [options]* -x <bt2-idx> {-1 <m1> -2 <m2> | -U <r> | --interleaved <i> | -b <bam>} [-S <sam>]

二、bowtie的使用

2.1 创建bowtie2的index索引

bowtie2-build [options]* <reference_in> <bt2_index_base>

操作:

bowtie2-build --threads 30 Sl.fa Bowtie2-index/Tomato-bowtie-index

参数:

-threads
	运行线程数量
--large-index 
	使用较大的索引。一般情况下基因组大于4G的时候,考虑使用大索引。

2.2 Bowtie2的比对

  1. Single End:
bowtie2 -p 10 -x 02_Geneome_index/Bowtie2-index/Tomato-bowtie-index -U input.fq -S **.sam 2> **.bowtie2.log
  1. Paired End:
bowtie2 -p 10 -x 02_Geneome_index/Bowtie2-index/Tomato-bowtie-index -1  **_1.fq.gz -2 **_2.fq.gz -S **.sam 2> **.bowtie2.log

可以使用管道符|进行sort排序

bowtie2 -p 10 -x 02_Geneome_index/Bowtie2-index/Tomato-bowtie-index -U input.fq | samtools sort  -O bam  -@ 10 -o - > output.bam

Bowti2参数设置:

  1. 必须参数:
-x 
	bowtie-bulid建立的索引
-1 
	双端测序中的第一个文件
-2 
	双端测序中的第二个文件
-U
	单端测序
-S 
	生成的Sam文件

  1. 输入参数(可选参数)
-q 
	输入的文件为fastq格式
-qseq
	输入文件为QSEQ格式
-f 
	输入的文件为fa的格式。选择此项,--ignore-quals也被选择
-r
  输入的文件,每一行代表每一条序列,没有序列名和测序质量等。

其他参数可以bowtie2 -h查看
3. 比对参数:

-N 
	进行种子比对时允许mismatch数,允许设置0或1。default:0
-L
	设置种子的长度
-i 
	设置两个相邻种子间的所间距的碱基数。
--ignore-quals
	计算错配罚分的时候不考虑碱基质量,当输入序列模式为-f,-r或-c的时候,该设置自动成默认设置。
--nofw/--norc
	--nofw设置reads不和前导链进行比对,--norc设置reads和后随链进行比对。
--end-to-end
	比对是将整个reads和参考序列进行比对,该模式下--ma的值为0

  1. 得分罚分参数:
--ma 
	设置匹配得分,--local模式下每个read上碱基和参考序列上发碱基匹配。在--end-to-end模式下无效,default:2
--mp MX,MN
	设定错配罚分。最大值MX,最小角值MN。default:MX = 6, MN = 2
--np 
	当匹配位点中read,reference上有不确定碱基时设定的罚分值。default:1
--ref
	设置reference上打开gap罚分<int1>z,延长gap罚分<int2>. defualt:5,3
  1. Paried end参数:
-I/ --minins <int>
	设定最小的插入片段长度。default:0
-X/ --maxins 
	设定最长的插入片段长度。default:500
--fr / --rf / --ff

--no-mixed
	默认设置下,一堆reads不能成对比对到参考基因序列上,则单独比对上每个reads进行比对。
  1. 输出参数:
-t/--time          print wall-clock time taken by search phases
--un <path>        write unpaired reads that didn't align to <path>
	`将unpaired reads输出到<path>
--al <path>        write unpaired reads that aligned at least once to <path>
	`将至少能比对1次以上的unpaired reads输出
--un-conc <path>   write pairs that didn't align concordantly to <path>
--al-conc <path>   write pairs that aligned concordantly at least once to <path>
    (Note: for --un, --al, --un-conc, or --al-conc, add '-gz' to the option name, e.g.
--un-gz <path>, to gzip compress output, or add '-bz2' to bzip2 compress output.)
	`将输出的reads进行gzip压缩`
--quiet            print nothing to stderr except serious errors
--met-file <path>  send metrics to file at <path> (off)
--met-stderr       send metrics to stderr (off)
--met <int>        report internal counters & metrics every <int> secs (1)
--no-unal          suppress SAM records for unaligned reads
--no-head          suppress header lines, i.e. lines starting with @
--no-sq            suppress @SQ header lines
--rg-id <text>     set read group id, reflected in @RG line and RG:Z: opt field
--rg <text>        add <text> ("lab:value") to @RG line of SAM header.
                     Note: @RG line only printed when --rg-id is set.
--omit-sec-seq     put '*' in SEQ and QUAL fields for secondary alignments.
--sam-no-qname-trunc Suppress standard behavior of truncating readname at first whitespace 
                      at the expense of generating non-standard SAM.
--xeq              Use '='/'X', instead of 'M,' to specify matches/mismatches in SAM record.
--soft-clipped-unmapped-tlen Exclude soft-clipped bases when reporting TLEN

若我们的分享对你有用,希望您可以点赞+收藏+转发,这是对小杜最大的支持。

往期文章:

1. 复现SCI文章系列专栏

2. 《生信知识库订阅须知》,同步更新,易于搜索与管理。

3. 最全WGCNA教程(替换数据即可出全部结果与图形)


4. 精美图形绘制教程

5. 转录组分析教程

转录组上游分析教程[零基础]

一个转录组上游分析流程 | Hisat2-Stringtie

小杜的生信筆記 ,主要发表或收录生物信息学的教程,以及基于R的分析和可视化(包括数据分析,图形绘制等);分享感兴趣的文献和学习资料!!

若我们的分享对你有用,希望您可以点赞+收藏+转发,这是对小杜最大的支持。

  • 25
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小杜的生信筆記

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值