解决方案

安装生物信息学软件-bowtie2

seo靠我 2023-09-23 22:41:34

好吧,这是本周(2016.10.21-28)的学习任务之一:安装bowtie2并学习其使用方法&参数设置

所以,啃文档咯,官方文档Version 2.2.9 http://bowtie-bio.sourceSEO靠我forge.net/bowtie2/manual.shtml

以下是我的整理。我不生产文档,我只是文档的搬运工么么哒~

Bowtie2适合将长度50-1000bp的reads比对到

的参考序列上。BowtSEO靠我ie 2 indexes the genome with an FM Index

(based on the Burrows-Wheeler Transform or BWT) 。输出结果为SAM格式。SEO靠我已集成在很多软件

中,如

TopHat(a fast splice junction mapper for RNA-seq

reads),

Cufflinks(transcriptome assemblyandSEO靠我 isoform quantitiation fromRNA-seq

reads),

Crossbow( cloud-enabled tool for analyzing reseuqncing data

)SEO靠我,

Myrna(a cloud-enabled tool for aligning RNA-seq reads and measuring differential gene expression)。

BowtSEO靠我ie1和2的区别:Bowtie 2s command-line arguments and genome index format are both differen

t from Bowtie 1s.

1,SEO靠我bowtie1出现的早,所以对于测序长度在50bp以下的序列效果不错,而bowtie2在长度在50bp以上的更好。

2,Bowtie 2支持有空位的比对Number of gaps and gap leSEO靠我ngths are not restricted, except by way of the configurable scoring scheme.

3,Bowtie 2支持局部比对(local, sSEO靠我ome chars will be omited/trimmed),也可以全局比对(end-to-end, all char participate)

4,Bowtie 2对最长序列没有要求,但是BowSEO靠我tie 1最长不能超过1000bp。

5. Bowtie 2 allows alignments to [overlap ambiguous characters] (e.g. `N`s) in theSEO靠我 reference. Bowtie 1 does not.

6,Bowtie 2不能比对colorspace reads.

7, Bowtie 2s paired-end alignment is moSEO靠我re flexible. Try to find unpaired alignments for each mate。

8, Bowtie 2 reports a spectrum of mappingSEO靠我 qualities, Bowtie 1 reports either 0 or high。

MUMmer: align 2 very large sequences(

eg: 2 genomes)

NUCmSEO靠我er, BLAT/BLAST, Bowtie2: sensitive alignment toshort ref seq(eg: a bacterial genome)

安装bowtie2: 直接下载bSEO靠我owtie2-2.2.9-linux-x86_64.zip,解压,修改环境路径即可

(设置环境路径请自行百度,或者参考这个http://www.cnblogs.com/pxy7896/p/5886305SEO靠我.html)

Scores: 更高分=更相似

--ma :match bonus

--mp :mismatch penalty

--np :penality for having N in either thSEO靠我e read or the ref

--rdg :affine read gap penalty

--rfg :affine ref gap penalty

全局比对栗子:默认,高质量位点的mismatchSEO靠我罚分为-6,长度为2的gap罚分为-11(gap open-5, extension-3),如果在长度为50的read中只有这两个问题,则总分为-17。所以,最好的分数是0,指read和ref完全相同SEO靠我

default min score threshold:

可以用--score-min

设置

-0.6-0.6*L(read长度)

局部比对栗子:罚分同上,但每个match获得bonus,+2,则如果是上面SEO靠我情况,则得分为2*49-6-11=81

default min score threshold:

20+8*ln(L)(read长度)

paired-end read:两个mate的分数相加

Mapping SEO靠我quality:higher=more unique如果一个read来自重复区域,则可能map到多个地方,所以需要知道比对的可信程度。在SAM文件中,MAPQ就是这个,值为Q=-10log10p。p是SEO靠我对比对错误的概率的估计。一个read越特殊,比对错误的概率越小,Q值越大。

bowtie2是对paired read的每个mate分别比对的,所以如果两个比对结果不符合预期(比如方向不合适或者距离不合适SEO靠我),就说是align discordantly

,这种在研究structural variants时有用。

--ff --fr --rf: expected relative orientation ofSEO靠我 the mates

-I and -X: expected range of inter-mates distances

--no-discordant: 禁止找discordant alignmentSEO靠我s

--no-mixed: mixed mode指对一个pair找不到paired-end alignment时,为每个mate找unpaired alignments。关了这个会快一点点。

SAM格式中SEO靠我有一些flag和optional fields描述了paired-end特征

Mates can overlap, contain, or dovetail each other

overlap:

contSEO靠我ain: mate2刚好是mate1的子序列

dovetail: 咬合,延长

bowtie2默认overlap和contain是concordant的,dovetai是disconcordant的。所以:SEO靠我

--no-overlap和--no-contain使得这两种情况变为disconcordant

--dovetail: 让dovetail变为concordant

Reporting mode:

dafauSEO靠我lt mode: 找多个匹配,报告最好的

-D和-R: 会使程序变慢,但是增大了找到最好比对的可能性(针对有多个比对的)

-k mode: 找一个或多个匹配,全报告

-k N找最多N个匹配,按比对分数降序排SEO靠我

-a mode: 找和报告所有的。对大基因组,这个会很慢。

bowtie2找匹配时采用随机的策略,会使用--seed产生随机数来选择需要报告的匹配。所以如果使用

--non-deterministic,SEO靠我则对同样的输入reads,可能会产生不同的比对结果输出。

To rapidly narrow the number of possible alignments that must be consideSEO靠我red, Bowtie 2 begins by

extracting substrings ("seeds") from the read and its reverse complement and SEO靠我aligning them in an

ungapped fashion with the help of the FM Index.

-L: seed length

-i: interval betweeSEO靠我n extracted seeds

-N: # mismatches permitted per seed

如果想要更sensitive的比对,可以减小L和i,增大N。同样,-D和-R也与此相关。

--n-SEO靠我ceil: upper limit on # N if valid

Presets: setting many settings at once

--very-sensitive: 等价于-D 20 -RSEO靠我 3 -N 0 -L 20 -i S,1,0.50 //可以查看文档得知

过滤:

bowtie2会在SAM记录里写出低质量read,YF:i SAM optional field 也会解释过滤它们的原因(SEO靠我多个原因只说一个),但是不会去比对它们。

YF:Z:LN read长度<=seed mismatches(-N)

YF:Z:NS read里N的数量>(--n-ceil)

YF:Z:SC 低于--scoreSEO靠我-min

YF:Z:QC 与--qv-filter设定相关。Illumina的QSEQ格式中,read最后一个域含1

small(32-bit numbers, for <4 billion nucleoSEO靠我tides in length, index.bt2) and large(64-bit numbers, .bt21) index自动选择,无需担心

Performance tuning:

-p: 多线SEO靠我

-o/--offrate: 使用bowtie2-build时,这个值比default设得小些。这样会有更大的index,适合-k和-a模式(报告多个比对的)。但如果计算机内存小,还是把这个值设大,减SEO靠我少内存消耗。

×××××××××××××××××××××××××××××××××××××××实验×××××××××××××××××××××××××××××××××××××××××××××××××××××SEO靠我××

Step 1:建索引

新建文件夹,在新文件夹下运行,

bowtie2-build /home/pxy7896/Downloads/bowtie2/example/reference/lambda_viSEO靠我rus.fa lambda_virus

结果:产生六个文件。(eg1,eg2,eg3是后面的)

可以使用预先建好的索引。

可以一次为多个文件建立索引,文件名之间用,分隔

Step 2: 比对reads

bowtSEO靠我ie2 -x lambda_virus -U /home/pxy7896/Downloads/bowtie2/example/reads/reads_1.fq -S eg1.sam

参数解释:

-x: 查SEO靠我看index文件首先在当前目录下找,找不到再去环境变量BOWTIE2_INDEXES下找。

-U: 后面跟需要比对的read文件。多个用,分隔。

-S: 后跟结果文件的名字。

比对结果写到eg1.sam,要SEO靠我查看:head eg1.sam

sam格式:(haven’t read yet)

Step 3: 比对paired-end reads

bowtie2 -x lambda_virus -1 /home/pxSEO靠我y7896/Downloads/bowtie2/example/reads/reads_1.fq -2 /home/pxy7896/Downloads/bowtie2/example/reads/reSEO靠我ads_2.fq -S eg2.sam

Step 4: long reads local alignment

bowtie2 --local -x lambda_virus -U /home/pxy789SEO靠我6/Downloads/bowtie2/example/reads/longreads.fq -S eg3.sam

samtools:(可以输入命令,查询可以选择的参数)

Step 5: sam转为bamSEO靠我格式 (binary format of sam)

samtools view -b /home/pxy7896/Desktop/eg/eg2.sam -o eg2.bam

Step 6: sam排序为.SEO靠我sorted文件(这是压缩了的文件,适合存储)

samtools sort eg2.bam -o eg2.sorted

Step 7: generate variant calls in VCF formSEO靠我at

发现居然没有装bcftools(for calling variants and manipulating VCF and BCF files)

sudo apt install bcftools

SEO靠我后执行

samtools mpileup -v -u -f $BT2_HOME/example/reference/lambda_virus.fa eg2.sorted | bcftools view SEO靠我-o eg2.raw.bcf

解释:将eg2.sorted和参考序列放一起比对,然后用bcftools将结果放到eg2.raw.bcf中

很奇怪,手册里的命令我运行的不对。。。可能还是这样找使用方法靠谱一SEO靠我点。

产生eg2.raw.bcf文件,大概长这个样子:

×××××××××××××××××××××××××××××××××××××××参数×××××××××××××××××××××××××××××××××SEO靠我××××××××××××××××××××××

bowtie2 

 bowtie2-build(关于目录建立)

bowtie2-inspect

转载于:https://www.cnblogs.com/pxy7896SEO靠我/p/5989820.html

“SEO靠我”的新闻页面文章、图片、音频、视频等稿件均为自媒体人、第三方机构发布或转载。如稿件涉及版权等问题,请与 我们联系删除或处理,客服邮箱:html5sh@163.com,稿件内容仅为传递更多信息之目的,不代表本网观点,亦不代表本网站赞同 其观点或证实其内容的真实性。

网站备案号:浙ICP备17034767号-2