Gene Ontology Annotation

GO 简介

大多数基因在不同生物中的同源基因拥有相同的主要生物学功能。 因此, 在某些物种里已知的基因功能信息可以用来解释其他物种对应的同源基因, 但是这些已知的功能信息包含在先前积累的浩瀚文献之中, 不同的文献会用不同的词汇来描述同一生物学功能, 这为功能检索和注释带来诸多不便。而 GO项目就是建立一套特定的词汇集合来描述生物学功能, 以此对基因功能注释统一化. 用于描述生物学功能的词汇必然要反映生物学功能的本质, 此即本体论的由来。从整体上来看GO注释包含三个分支,即生物学过程(Biological Process),分子功能(Molecular Function),细胞组分(Cellular Component)。

GO 注释方法:

1、将要注释的氨基酸序列使用Interproscan(InterPro是个数据库,里面包含蛋白功能、蛋白家族等信息,而Interproscan可以将蛋白序列跟这个数据库比对,从而给序列功能注释),得到该蛋白的对应的IPR 和 GO id等信息。

Interproscan在线网站: Interproscan

2、Interproscan输出结果out.ipr解析

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/perl -w
use strict;
my $entry_list = "/home/ztt/temp/Entry_list.xls";
my $input = shift;
open FILE,$entry_list;
my %type;
my %out;
my %go;
while (<FILE>){
chomp;
my @a = split;
$type{$a[0]} = $a[1];
}
open FILE,$input;
while (<FILE>){
chomp;
my @a = split /\t/;
if ($a[11] and $type{$a[11]} eq 'Domain'){
$out{$a[0]}{$a[11]}=$a[12];
}
if ($a[13]){
my @go = split /\|/, $a[13];
foreach my $go (@go){
$go{$a[0]}{$go}=1;
}
}
}
open OUT1,">go.xls";
foreach my $k1 (keys %go){
print OUT1 "$k1\t";
foreach my $k2 (keys %{$go{$k1}}){
print OUT1 "$k2\t";
}
print OUT1 "\n";
}
open OUT,">Domain_annotation.xls";
print OUT "Protein accession\tIPR name\tDomain description\n";
foreach my $k1 (keys %out){
print OUT "$k1\t";
foreach my $k2 (keys %{$out{$k1}}){
print OUT "$k2; ";
}
print OUT "\t";
foreach my $k2 (keys %{$out{$k1}}){
print OUT "$out{$k1}{$k2}; ";
}
print OUT "\n";
}

3、GO注释

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/perl -w
use strict;
use GO::OntologyProvider::OboParser;
if(@ARGV<2){
print STDERR "\tUsage:\n\t\tperl $0 go_list obo_file\n\n";
exit;
}
my $all_go_list = shift;
my $ontologyFile = shift;
my $ontology_F = GO::OntologyProvider::OboParser->new(ontologyFile => $ontologyFile,aspect=>"F");
my $ontology_P = GO::OntologyProvider::OboParser->new(ontologyFile => $ontologyFile,aspect=>"P");
my $ontology_C = GO::OntologyProvider::OboParser->new(ontologyFile => $ontologyFile,aspect=>"C");
open FILE,$all_go_list;
my %out;
while(<FILE>){
chomp;
my @a = split /(\t|; )/;
my $gene_name = shift @a;
foreach my $go_id(@a){
my $nodeF = $ontology_F->nodeFromId($go_id);
my $nodeC = $ontology_C->nodeFromId($go_id);
my $nodeP = $ontology_P->nodeFromId($go_id);
if($nodeF){
my $temp = annotate($nodeF,$gene_name);
foreach my $k1(keys %$temp){
$out{$gene_name}{'Molecular Function'}{$k1}{'name'}=$temp->{$k1}->{'name'};
$out{$gene_name}{'Molecular Function'}{$k1}{'level'}=$temp->{$k1}->{'level'};
}
}
if($nodeC){
my $temp = annotate($nodeC,$gene_name);
foreach my $k1(keys %$temp){
$out{$gene_name}{'Cellular Component'}{$k1}{'name'}=$temp->{$k1}->{'name'};
$out{$gene_name}{'Cellular Component'}{$k1}{'level'}=$temp->{$k1}->{'level'};
}
}
if($nodeP){
my $temp = annotate($nodeP,$gene_name);
foreach my $k1(keys %$temp){
$out{$gene_name}{'Biological Process'}{$k1}{'name'}=$temp->{$k1}->{'name'};
$out{$gene_name}{'Biological Process'}{$k1}{'level'}=$temp->{$k1}->{'level'};
}
}
}
}
foreach my $k1(keys %out){
foreach my $k2(keys %{$out{$k1}}){
foreach my $k3(keys %{$out{$k1}{$k2}}){
print "$k1\t$k2\t$k3\t$out{$k1}{$k2}{$k3}{'level'}\t$out{$k1}{$k2}{$k3}{'name'}\n";
}
}
}
sub annotate{
my $node = shift;
my @pathtoRoot=$node->pathsToRoot;
my %out_node;
my $max=0;
$out_node{$node->goid}{"name"}=$node->term;
foreach my $path(@pathtoRoot){
if(@$path>$max){
$max=@$path;
}
if(@$path>1){
for(my $i=1;$i<@$path;$i++){
$out_node{$path->[$i]->goid}{"name"}=$path->[$i]->term;
unless($out_node{$path->[$i]->goid}{"level"}){
$out_node{$path->[$i]->goid}{"level"}=$i;
}
else{
if($out_node{$path->[$i]->goid}{"level"}<$i){
$out_node{$path->[$i]->goid}{"level"}=$i;
}
}
}
}
}
$out_node{$node->goid}{"level"}=$max;
return \%out_node;
}