Octave的安装

GNU Octave is a high-level interpreted language, primarily intended for numerical computations. It provides capabilities for the numerical solution of linear and nonlinear problems, and for performing other numerical experiments. It also provides extensive graphics capabilities for data visualization and manipulation. Octave is normally used through its interactive command line interface, but it can also be used to write non-interactive programs. The Octave language is quite similar to Matlab so that most programs are easily portable.

CentOS安装octave,使用源码包安装会出很多问题,使用yum安装简单容易。

# vim /etc/yum.repos.d/naulinux-school.repo

[naulinux-school]
name=NauLinux School
baseurl=http://downloads.naulinux.ru/pub/NauLinux/6.2/$basearch/sites/School/RPMS/
enabled=0
gpgcheck=1
gpgkey=http://downloads.naulinux.ru/pub/NauLinux/RPM-GPG-KEY-linux-ink

# yum --enablerepo=naulinux-school install octave*
# yum install hdf5*

# ln -s /usr/lib64/mpich2/lib/libhdf5.so.6.0.4 /usr/lib64/libhdf5.so.6

SNAP的安装和使用

1. SNAP简介

SNAP是Ian Korf独自开发的软件,简单易用。

2. SNAP的安装

$ wget http://korflab.ucdavis.edu/Software/snap-2013-02-16.tar.gz
$ tar zxf snap-2013-02-16.tar.gz
$ cd snap
$ make

3. SNAP的Parameter Estimation

3.1 需要 genes that are not too related to each other。和AUGUSTUS一致,基因两两之间的identity不要超过80%。Gene structures must be in ZFF format.

ZFF格式是Ian Korf自行使用的一个格式,有长短两种格式。In the short format, there are 4 fields: Label, Begin, End, Group.if Begin > End, the feature is on the minus strand.

>sequence-1
Einit    201    325   Y73E7A.6
Eterm   2175   2319   Y73E7A.6
>sequence-2
Einit    201    462   Y73E7A.7
Exon    1803   2031   Y73E7A.7
Exon    2929   3031   Y73E7A.7
Exon    3467   3624   Y73E7A.7
Exon    4185   4406   Y73E7A.7
Eterm   5103   5280   Y73E7A.7

不管是在正链,还是负链,从上到下,起始位置是逐渐变大的;如果是在正链上,Begin > End, Einit在Eterm前面;如果是在负链上,则 Begin < End, Eterm在Einit前面。 3.2 做Parameter Estimation需要一定数目的genes,这些genes的ZFF文件和相应的genome序列文件。

注意geneome序列文件只是包含有这些基因的序列,如果含有其它的序列的话,程序运行会出问题(core dump等)。

使用gff3_to_zff.pl来将gff3文件转换成zff文件; 再使用order.pl来调整Einit, Exon, Eterm的顺序。

$ ./gff3_to_zff.pl genes.gff3 > genes.zff
$ ./order.pl genes.zff > species.ann

提取出相应的genome的序列,并对其进行排序:

$ grep '^>' species.ann | tr -d '>' > species.seqs2keep
$ ./fasta_sort.pl species.seqs2keep < geome.fasta > species.dna

3.3 检测genes中的错误和警示,然后对genes进行修正或丢弃

$ $SnapHome/fathom species.ann species.dna -gene-stats &> gene-stats.log
$ $SnapHome/fathom species.ann species.dna -validate &> validate.log

$ grep OK validate.log > species.zff2keep
$ perl -p -i -e 's/.*:\s+(\S+)\s+OK/$1/' species.zff2keep
$ ./filterGenes.pl species.zff2keep species.ann > tmp
$ mv tmp species.ann

3.4 将序列打断成一个序列一个gene的片段,在CDS两端各加1000bp长度序列,并将所有的genes转换到正义链上。

$ $SnapHome/fathom species.ann species.dna -categorize 1000
$ $SnapHome/fathom species.ann species.dna -export 1000

3.5 run the parameter estimation program

$ mkdir params; cd params
$ $SnapHome/forge ../export.ann ../export.dna 
$ cd ..

3.6 Last is to build an HMM

$ $SnapHome/hmm-assembler.pl species params > species.hmm

SNAP的Parameter Estimation能很快地完成。不像AUGUSTUS那样耗时。

4. 运行snap进行基因预测

$ $SnapHome/snap species.hmm species.geonme > species.zff
$ $SnapHome/zff2gff3.pl species.zff > species.gff3

5. 将预测的zff结果转换成gff3结果

在4中转换成的gff3文件的最后一列attributes中,只有Name标签。而使用EVM软件将基因预测结果融合的时候,需要的gff3文件中该列的标签有ID和Parent,因此需要其它的方法来将zff文件转换成gff3文件。可以使用EVM包含的一个perl程序来解决。

使用该程序需要先将EVM自带的一些perl模块export到其路径;同时需要安装cdbfasta

$EVMHome/OtherGeneFinderTrainingGuid/SNAP/SNAP_output_to_gff3.pl species.zff species.geome > species.gff3

SNAP基因ab initio的基因预测速度很快。