Bowtie使用介绍

1 35,397

Bowtie是一个超级快速的,较为节省内存的短序列拼接至模板基因组的工具。它在拼接35碱基长度的序列时,可以达到每小时2.5亿次的拼接速度。Bowtie并不是一个简单的拼接工具,它不同于Blast等。它适合的工作是将小序列比对至大基因组上去。它最长能读取1024个碱基的片段。换言之,bowtie非常适合下一代测序技术。

下面是官方的简短介绍:

Bowtie is an ultrafast, memory-efficient short read aligner. It aligns short DNA sequences (reads) to the human genome at a rate of over 25 million 35-bp reads per hour. Bowtie indexes the genome with a Burrows-Wheeler index to keep its memory footprint small: typically about 2.2 GB for the human genome (2.9 GB for paired-end).

在使用bowtie前,需要使用bowtie-build来构建比对模板。如果你需要比对是比较常见的基因组的话,你可以去 http://bowtie-bio.sourceforge.net/manual.shtml下载你所需要的Pre-built indexes文件就可以了。

如前所述,bowtie适合于将短序列拼接至大的模板上,尤其是基因组。模板最小尺寸不能小于1024碱基,而短序列最长而不能超过1024碱基。 Bowtie设计思路是,1)短序列在基因组上至少有一处最适匹配, 2)大部分的短序列的质量是比较高,3)短序列在基因组上最适匹配的位置最好只有一处。这些标准基本上和RNA-seq, ChIP-seq以及其它一些正在兴起的测序技术或者再测序技术的要求一致。

如果bowtie在你的机器上运行起来很慢,那么你可以试试以下的一些办法来让它跑得快一些:

  1. 尽可能的使用64位bowtie。很显然,64位运算会比32位运算更快。所以最好使用支持64位运算的计算机来运行64位的bowtie。如果你是从原文件开始编译程序,在g++编译时,你需要传递-m64参数,你也可以在make的时候加入这一信息,比如说传递BITS=64给make,具体的:make BITS=64 bowtie。想知道你自己运算的是什么版本的bowtie,你可以运行bowtie –version
  2. 如果你的计算机有多个CPU或者CPU内核,那么请使用-p参数。-p参数会让bowtie进入多线程模式。每一个线程都会使用单独的CPU或者CPU内核。这种并行的运算模式也会大大加快运算速度。
  3. 如果你的报告文件中每条短序列都有太多的匹配位点(超过10)那么你可以试着重新使用bowtie-build加上 –offrate参数,如bowtie-build –offrate 4。-o/–offrate默认值为5,每下降1,比对速度会增加1倍,但是系统消耗(硬盘空间和内存)也会加倍。
  4. 如果你的系统配置太低,比如内存不足4GB,那么建议你在bowtie的时候使用–offrate参数。与上一条相反的,你需要加大 offrate的值。bowtie –offrate 6. 其默认值为5。每增加1,内存空间的要求下降,这样会减少读取硬盘当中虚拟内存的次数,速度反而会有所上升。

-n模式与-v模式

默认的,bowtie采用了和Maq一样的质量控制策略,设置 -n 2 -l 28 -e 70。总的来说,比对模式分为两种,一种是 -n 模式, 一种是 -v 模式,而且这两种模式是不能同时使用的。bowtie默认使用-n模式。

-n模式参数: -n N -l L -e E

其中N,L,E都为整数。-n N 代表在高保真区内错配不能超过N个,可以是0?3,一般的设置为2。-l L代表序列高保真区的长度,最短不能少于5,对于短序列长度为32的,设置为28就很不错。-e E代表在错配位点Phred quality值不能超过E,默认值为40。Phred quality值的计算式为:-10 log(P,base(10))

Phred Quality值错配可能性正配可能性
101/1090%
201/10099%
301/100099.9%
401/1000099.99%
501/10000099.999%

而-v模式的参数相对较少。

-v模式参数:-v V

其中V为整数。-v V代表全长错配不能超过V个,可以是0?3。这时,不考虑是否高保真区,也不考虑Phred quality值。

–best 与–strata

–best参数代表报告文件中,每个短序列的匹配结果将按匹配质量由高到低排序。–strata参数必须与–best参数一起使用,其作用是只报告质量最高的那部分。所谓质量高低,其实就是指错配的碱基数,如果指定了-l L参数,那就是在高保真区内的错配数,否则就是全序列的错配数。如果你还指定了 -M X的话,那就会在质量最高的当中,随机选择X个来报告。也就是说,当我们指定了-M 1 –best –strata的话,那就只报告1个最好的。

对于输入,-q是指输入的文件为FASTQ(文件扩展名通常为.fq或者.fastq)格式;-f是指输入文件为FASTA(文件扩展名通常为.fa, .mfa或者.fna)格式;-c是指在命令行直接输入要比对的序列。

下面就是一个具体的例子:

bowtie -v 2 -M 1 –best –strata Genomes/hg19_ebwt/hg19 Pol2ChIP.fastq Pol2ChIP.map

./bowtie -S -t -p 8 -q --chunkmbs 128 hg18_combined.fa.bowtie -1 Pair1.fastq -2 Pair2.fastq bowpeout.sam

./bowtie -S -t -p 8 -q -I 0 -X 300 --chunkmbs 128 hg18_combined.fa.bowtie -1 Pair1.fastq -2 Pair2.fastq bowpeout.sam

time bowtie -p 2 -v 2 -k 11 -m 10 -t --strata --best hg19.index -1 sample_10M_1.fastq -2 sample_10M_2.fastq sample.bowtie_aln.txt

bowtie-p 5 -m 10 -f trx -1 mate1.fa -2 mate2.fa >output

附带关于reads的orientations介绍:

There is no --rr because that is the same as --ff, molecularly speaking. The 'f' and 'r' do not refer to the strand which the read aligns to, but the relative orientation of read1 and read2. The relative orientation of the reads 1 and 2 is determined by the method used to generate the paired reads; it should be identical for all read pairs in your data set and you should now what the expected orientation is based on the method used to construct the paired end library. (Let's ignore for now that unexpected pair orientations can signal structural variations.)

The --fr orientation means that the two reads are aligned to opposite strands and are pointed toward each other (i.e. the 3' ends of the reads are closer together than the 5' ends).

The --rf orientation means that the two reads are aligned to opposite strands and are pointed away from each other (i.e. the 5' ends of the reads are closer together than the 3' ends).

The --ff orientation means that both reads are aligned to the same strand and are pointed in the same direction. Further, read1 should always be 5' to read2, relative to the strand they are aligned to. In the two cases above you should have an equal distribution of read1 being the read "on the left".

Read pairs in the --fr orientation are produced using the Illumina paired end protocol. Read pairs in the --rf orientation are produced using the Illumina mate-pair protocol. Read pairs in the --ff orientation are produced in using the SOLiD mate-pair protocol.

参考来源:才华的BLOG(http://blog.sina.com.cn/cangrow)

    • yolandaking 1

      点赞

    发表评论

    匿名网友