Augustus training

Augustus training

1. Convert GFF file to Genbank format file

$ $AugustusHome/scripts/gff2gbSmallDNA.pl PASA.gff genome.fa 1000 genes.raw.gb

将gff文件转换成genebank格式,左右侧翼各加1000bp序列。gff文件可以由PASA将RNA-Seq的转录子比对到genome得到。而PASA得到的gff文件是有5’端非翻译区注释的,这样的信息会被trainig忽略。it is sufficient to have only the coding parts of the gene structure (CDS).

当然,genebank文件也可以使用NCBI的nucleotide数据库进行检索得到。

2. remove these problematic locis from genes.raw.gb

$ $AugustusHome/bin/etainig --species=SPECIES --stopCodonExcludedFromCDS=false genes.raw.gb 2> train.err
$ cat train.err | perl -pe 's/.*in sequence (\S+): .*/$1/' > badgenes.lst
$ $AugustusHome/scripts/filterGenes.pl badgenes.lst genes.raw.gb > genes.gb

第一条命令用于输出trainig过程中的错误信息,根据错误信息找到 badgenes,然后在去掉这些badgenes,剩下的genes用于training。

值得注意的是:

1. 至少有200个gene structures用于training,才能得到不错的结果。越多的gene,则training的效果越好;当然,达到1000个genes的时候,提升的效果就很小了。

2. 当有多于1000个基因的时候,则需要注重基因的质量,而不是数量了。要保证multi-exon genes的数目要多,这样用于tain the introns。并且gene structures越精确越好。

3. gene set should be non-redundant.如果2个不同的基因序列绝大部分的amino acid sequence是一致的,则去掉其中一个。推荐的条件是:gene set里面任意两个gene在amino acid level上的identity要不高于80%。可以使用blast来解决,由于80%的阈值算是比较高的,一般也就需要去除掉20多个基因。

3. Split gene structure set into training and test set

$ $AugustusHome/scripts/randomSplit.pl genes.gb 100

将genes.gb分隔成了genes.gb.test和genes.gb.train两个文件。其中前者为genes.gb中随机取出的100个genes,后者为剩下的genes。后者将用于不停地traning。

4. CREATE A META PARAMETERS FILE FOR YOUR SPECIES

$ $AugustusHome/scripts/new_species.pl --species=lentinula_edodes

假如我们要建立香菇物种的traning参数,则上命令建立了其参数文件和文件夹,不过文件内容是初始的。

注意的是,用于training的gene的最后一个CDS的最后3个碱基若不是终止密码子,则需要手动修改Lentinula_edodes_parameters.cfg文件,将其中的stopCodonExcludedFromCDS由默认的false改为true。

5. MAKE AN INITIAL TRAINING

$ $AugustusHome/bin/etrainig --species=lentinula_edodes genes.gb.train
$ $AugustusHome/bin/augustus --species=lentinula_edodes genes.gb.test | tee firsttest.out
$ grep -A 22 Evalustion firsttest.out

使用genes.gb.train做一次trainig,然后使用genes.gb.test来检测training的精确性。分别在nucleotide,exon和gene level上检测其sensitivity和specificity。

sensitivity表示被被检测出来的百分率;specificity表示检测出来的nucleotide,exon或gene和test set中的完全一致的百分率。

6. RUN THE SCRIPT optimize_augustus.pl

$ $AugustusHome/scripts/optimize_augustus.pl --species=lentinula_edodes --cpus=8 genes.gb.train
$ $AugustusHome/bin/etrainig --species=lentinula_edodes genes.gb.train
$ $AugustusHome/bin/augustus --species=lentinula_edodes genes.gb.test

1. optimize_augustus.pl所做的事情:

默认情况下,optimize_augustus.pl将genes.gb.train中的genes随机分成8等份,然后使用其中的7个等份的genes做training,另外的1个做精确性评估。这样相互下来,共有8个方案,每个方案取1个等份用于精确性评估,另外7个用于training。

进行一次随机分配后再运行10次training和精确性评估,即为一次预测,得到一个target value。该值是 base,exon和gene level上sensitivities和specificities的权重值。

每次预测,如果得到更高的target value,则修正参数文件中的值:lentinula_edodes_parameters.cfg。

默认下参数文件中有28项参数需要按一定顺序进行优化;一般情况下每个参数最多设置5个值各进行一次预测(即对一项参数而言,这设置的5个值其中可能有1个值是用于之前的预测,故每个参数优化需要运行最多5次预测),取最大的target value对应的值为参数的值;对所有的参数进行优化一次是一轮,则5轮参数优化完毕后程序会停止运行(以1800左右个genes来进行training,则每次augustus对200多个gene进行预测需要1min,那么每个参数优化需要28*4*8*1min=896min=15h,5轮参数的优化总共需要75h,即3天),或如果在一轮参数优化中没有improvements则提前停止运行。当然,如果等不及,也能手动停止程序运行。由于optimize_augustus.pl运行时间太长,最好使用screen来运行。

如果了解了上述运行原理,则可以视情形终止其运行,或保存配置文件后接着运行。

2. 在optimize_augustus.pl完成或中断之后,需要(re)train AUGUSTUS with genes.gb.train。然后在使用genes.test.gb进行预测的精确性检测,如果gene level sensitivity低于20%,则表明training set不够大,或者质量不够好,或者物种somehow special。

7. Training AUGUSTUS UTR parameters

这部分的Training则需要5’和3’端的UTR都存在的gene structure。

Augustus使用技巧

1. Predict Genes ab initio

Ab initio prediction means that no other input is used than the target genome itself. Predict the genes in the range 7,000,001-7,500,000 of chr2R of D. melanogaster. Use the FASTA format file chr2R.fa, which includes the whole chromosome 2R.

augustus --species=fly --predictionStart=7000001 --predictionEnd=7500000 chr2R.fa > augustus.abinitio.gff   # takes ~1m

If you want the protein sequences you can retrieve them with

getAnnoFasta.pl augustus.abinitio.gff

2. Predic Genes Using Hints

augustus --species=fly --predictionStart=7000001 --predictionEnd=7500000 chr2R.fa \
  --extrinsicCfgFile=extrinsic.bug.cfg --hintsfile=hints.gff > augustus.hints.gff

3. Creating hints from ESTs or assembled RNAseq transcripts with BLAT

4. Creating hints from proteins with Exonerate

5. Run AUGUSTUS predictions parallel

6. RNAseq integration (raw reads)

6.1 Incorporating RNAseq data into AUGUSTUS predictions with BLAT (including iterative mapping)

6.2 Incorporating RNAseq data with GSNAP (including iterative mapping)

6.3 Incorporating RNAseq data with Bowtie/Tophat (including iterative mapping)

6.4 Incorporating RNAseq data with Palmapper?

7. Training AUGUSTUS