RNA-seq差异表达基因分析之TopHat篇
TopHat是基于Bowtie的将RNA-Seq数据mapping到参考基因组上,从而鉴定可变剪切(exon-exon splice junctions)。
安装
最简单的安装方法,注意版本
- 下载Bowtie、TopHat、Cufflinks的二进制发布包,解压到相同的目录
- 下载samtools,make,将生成的可执行samtools程序也cp到同一个目录
- 增加该目录到PATH
参数与使用
Usage: tophat [options]* <index_base> <reads1_1[,…,readsN_1]> [reads1_2,…readsN_2]
- -o 输出目录,默认值为 “./tophat_out”。
- –solexa-quals/solexa1.3-quals 质量编码,关于质量编码格式请参考《Fastq格式详解》
- -p 线程数,默认值为单线程1.,可以使用多线程
- -G/–GTFSupply TopHat with a set of gene model annotations and/or known transcripts, as a GTF 2.2 or GFF3 formatted file.指定已有转录本信息
- –no-novel-juncs 不查找新的可变剪切
- -r 比对时两成对引物间的距离中值。比如说,如果你的插入片段有300bp,而每个引物有50bp,那么r值就应该是200=(300+50*2)/2。没有默认值,如果是末端配对比对时这个值是必须的。
- –mate-std-dev 末端配对时中间插入片段的长度的标准差,默认值为20bp
paired-end数据应该如何做
paired end reads是好还是坏,好又好在哪里?如何从结果中体现,如何同一批paired-end reads 使用paired-end 参数与不适用差别在哪里?
READS文件
paired end的reads必须放在不同的两个文件中,文件名必须按照*_1, *_2的规范成对出现,Mixing paired- and single- end reads together is not supported.不要将paired-end的数据与single end reads放到一起进行处理。
设置-R参数
大多数情况,使用默认值就可以了,TopHat允许一定量的偏差,TopHat在多个地方使用到这个值,比如当寻找剪切位点与fusion break point。同时在生成报告的最后阶段选择最佳的alignment时,用到这个信息。可以先用少量的数据进行比对,在比对结果的SAM结果中,对于paired reads,第九列是插入片段的大概长度,可以用这个数值减去两倍的read的长度,就可以得到实际的-r参数需要设置的大小,如果值太大应该小心,只有比对上同一个外显子的情况具有意义。
控制结果的参数
- –no-discordant For paired reads, report only concordant mappings.对于成对的读取,只报告一致的映射。
- –no-mixed For paired reads, only report read alignments if both reads in a pair can be mapped (by default, if TopHat cannot find a concordant 和谐 or discordant 不和谐 alignment for both reads in a pair, it will find and report alignments for each read separately分别; this option disables that behavior).
结果读取
常见的错误及其解决思路
[ERRNO 2]NO SUCH FILE OR DIRECTORY
[Thu Oct 18 17:20:15 2012] Beginning TopHat run (v1.3.2)
-----------------------------------------------
[Thu Oct 18 17:20:15 2012] Preparing output location ./tt/
[Thu Oct 18 17:20:15 2012] Checking for Bowtie index files
[Thu Oct 18 17:20:15 2012] Checking for reference FASTA file
[Thu Oct 18 17:20:15 2012] Checking for Bowtie
Bowtie version: 0.12.8.0
[Thu Oct 18 17:20:15 2012] Checking for Samtools
Samtools Version: 0.1.18
[Thu Oct 18 17:20:15 2012] Generating SAM header for ./hg19/genome
[Thu Oct 18 17:20:38 2012] Preparing reads
format: fastq
quality scale: solexa33 (reads generated with GA pipeline version < 1.3)
[Thu Oct 18 17:20:38 2012] Reading known junctions from GTF file
Left reads: min. length=35, count=53327887
[Thu Oct 18 18:05:11 2012] Mapping left_kept_reads against genome with Bowtie
[Thu Oct 18 23:04:52 2012] Processing bowtie hits
[Thu Oct 18 23:52:29 2012] Mapping left_kept_reads_seg1 against genome with Bowtie (1/4)
[Fri Oct 19 03:59:45 2012] Mapping left_kept_reads_seg2 against genome with Bowtie (2/4)
[Fri Oct 19 08:04:09 2012] Mapping left_kept_reads_seg3 against genome with Bowtie (3/4)
[Fri Oct 19 11:55:20 2012] Mapping left_kept_reads_seg4 against genome with Bowtie (4/4)
[Fri Oct 19 15:37:53 2012] Searching for junctions via segment mapping
[Fri Oct 19 16:24:47 2012] Retrieving sequences for splices
[Fri Oct 19 16:30:15 2012] Indexing splices
[Fri Oct 19 16:30:41 2012] Mapping left_kept_reads_seg1 against segment_juncs with Bowtie (1/4)
[Fri Oct 19 17:05:17 2012] Mapping left_kept_reads_seg2 against segment_juncs with Bowtie (2/4)
[Fri Oct 19 17:39:56 2012] Mapping left_kept_reads_seg3 against segment_juncs with Bowtie (3/4)
[Fri Oct 19 18:13:04 2012] Mapping left_kept_reads_seg4 against segment_juncs with Bowtie (4/4)
[Fri Oct 19 18:43:58 2012] Joining segment hits
[Fri Oct 19 19:37:28 2012] Reporting output tracks
[FAILED]
Error: [Errno 2] No such file or directory
[samopen] SAM header is present: 25 sequences.
可能的原因:
- 安装问题,排除这个问题是,安装后进行测试, http://tophat.cbcb.umd.edu/tutorial.html,测试没有成功,就要就地排除问题,使用二进制包,解压一下,一般不会出现安装问题;
- 参数路径问题,例如必须是绝对路径,实际确认相对路径也可以;
- 这个具体示例中,是环境变量问题, All it’s doing is saying that it can find Samtools but can’t use it because it’s not in its PATH.,没有将samtool所在目录加入PATH
- 索引问题,参考基因组索引有问题,或者索引的版本有问题,需要进行确认;
- 缺少基因组fa文件
- paired-end,只有left reads(我猜测,可能,但是猜测错误);
- 版本问题(很少是这个原因)
- 权限与磁盘空间问题,很少是这个原因引起的
[FAILED]ERROR RUNNING ‘PREP_READS’ TERMINATE CALLED AFTER THROWING AN INSTANCE OF ‘INT’
质量编码设置错误,如果不确认质量编码方式,可以使用自动判别脚本进行检查。
排除错误的思路,确认程序是执行到哪一步出的错误,可以中日志(run.log)文件中看到,通常的顺序是:
- gtf_juncs
- prep_reads 这里报告错误,读取reads有问题
- bowtie|fix_map_ordering
- long_spanning_reads
- segment_juncs
- juncs_db
- bowtie-build
- bowtie|fix_map_ordering
- segment_juncs
- juncs_db
- bowtie-build
- bowtie
- long_spanning_reads
- bam_merge
- bowtie
- long_spanning_reads
- bam_merge
- tophat_reports | samtools 调用samtools发生错误