首先下载并安装GO::TermFinder
perl -MCPAN -e shell
cpan> install GO::TermFinder
安装完成之后,至example下载GoView.conf, *.pl,以及examples.html文件。其实这些也已经安装在了本机,你也可以在安装目录下找到。
这里主要介绍使用batchGOView.pl来直接生成报告文件。我们先看一眼batchGoView.pl的原代码。
#读取配置文件 my $confFile = shift; my $conf = &ReadConfFile($confFile); #依据配置文件高置参数 my $ontology = GO::OntologyProvider::OboParser->new(ontologyFile => $conf->{'ontologyFile'}, aspect => $conf->{'aspect'}); my $annotation = GO::AnnotationProvider::AnnotationParser->new(annotationFile=>$conf->{'annotationFile'}); …… my $termFinder = GO::TermFinder->new(annotationProvider=> $annotation, ontologyProvider => $ontology, aspect => $conf->{'aspect'}, @additionalArgs); #生成报告文件 my $report = GO::TermFinderReport::Html->new(); &GenerateFrameset;#报告文件规范 …… #依次读取文件并分析 foreach my $file (@ARGV){ print "Analyzing $file\n"; # 从文件中读取基因列表,从这个命令中我们可以看出,基因文件的格式必须是每行一个基因名这样的格式,中间无空行。 my @genes = GenesFromFile($file); # 进行从基因名到GO名目的映射。 my @pvalues = $termFinder->findTerms(genes => \@genes, calculateFDR => $conf->{'calculateFDR'}); # 调用GO::View module来生成报告所需的图片。 my $goView = GO::View->new(-ontologyProvider => $ontology, -annotationProvider => $annotation, -termFinder => \@pvalues, -aspect => $conf->{'aspect'}, -configFile => $confFile, -imageDir => $conf->{'outDir'}, -imageLabel => "Batch GO::View", -nodeUrl => $conf->{'goidUrl'}, -geneUrl => $conf->{'geneUrl'}, -pvalueCutOff => $conf->{'pvalueCutOff'}); # 而后将这些结果整合到html中来,以便查看。 my $imageFile; if ($goView->graph) { $imageFile = $goView->showGraph; } my $htmlFile = &GenerateHTMLFile($file, $goView->imageMap, \@pvalues, scalar($termFinder->genesDatabaseIds), "Terms for $file"); print $listFh a({-href => $htmlFile, -target => 'result'}, $htmlFile), br; } …… |
接着就是了解配置文件的设置了。重点的有
## 注释文件,这个文件可以自己生成,规范是:http://www.geneontology.org/GO.annotation.shtml#script ## 但是主要的一些物种的注释文件可以直接下载,下载地址:http://www.geneontology.org/GO.downloads.annotations.shtml ## 下载后解压,放置到合适的目录下。 annotationFile = ../t/gene_association.sgd ## ontology文件,下载地址:http://www.geneontology.org/GO.downloads.ontology.shtml ontologyFile = ../t/gene_ontology_edit.obo ## GO分析的类别。我们知道GO数据库被分成了三个大类,分别是cellular_component, biological_process和molecular_function ## 所以这里的参数有三种可能:C, P 或者 F。每次只能设置一个。 aspect = P |
设置好这些,我们就可以开始使用了。使用例:
Usage: perl batchGOView.pl <.conf_file> <file1> <file2> <file3> ... <fileN> e.g. perl batchGOView.pl GoView.conf genes.txt genes2.txt |
然后就可以看报告了。
想说关于非模式生物的转录组后续的GO/KEGG富集要怎么做?
分三步:1先学会模式生物的做法。2学会做Hypergeometric Tests。3.对非模式生物建立library,然后做hypergeometric test.