[ensembl-dev] a question about GO annotation

JiangMei gingerplum at hotmail.com
Wed Sep 12 17:20:34 BST 2012


Hi All. Sorry to bother you.

I wrote two scripts to fetch genes annotated with specific GO terms. The scripts are shown in the following:

Script 1:
#Store target genes in @genelist
my @genelist;

use Bio::EnsEMBL::Registry;
my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db(
      -host       =>'ensembldb.ensembl.org',
      -user       =>'anonymous',
      -db_version =>'67');
my $go_adaptor=$registry->get_adaptor( 'Multi', 'Ontology', 'GOTerm' );
my $gene_adaptor=$registry->get_adaptor( 'drosophila melanogaster', 'Core', 'Gene' );

for $gene(@{$gene_adaptor->fetch_all}){
      my @db_links=@{$gene->get_all_DBLinks('GO')};
      for $dbe(@db_links){
            my $go_name=$dbe->description;
            push @genelist,$gene->stable_id if $go_name=~/transcription|chromatin/;
     }
}

Script 2:
#Store target genes in @genelist
my @genelist;

use Bio::EnsEMBL::Registry;

my $registry = 'Bio::EnsEMBL::Registry';

$registry->load_registry_from_db(

      -host       =>'ensembldb.ensembl.org',

      -user       =>'anonymous',

      -db_version =>'67');
my $go_adaptor=$registry->get_adaptor( 'Multi', 'Ontology', 'GOTerm' );
my $gene_adaptor=$registry->get_adaptor( 'drosophila melanogaster', 'Core', 'Gene' );

for $term(@{$go_adaptor->fetch_all}){

      my $name=$term->name;

      my $acc=$term->accession;

      if(($acc=~/^GO:/)&&($name=~/transcription|chromatin|histone/)){

         for $gene(@{$gene_adaptor->fetch_all_by_GOTerm($term)}){

               push @genelist,$gene->stable_id;

         }

     }

}

Basically, Script 1 fetched all the genes, then got GO annotations for each gene. If GO matched the regular express, then push gene ID to @genelist. Script 2 fetched all the GO terms and if GO matched the regular expression, push gene ID to @genelist. The two scripts were supposed to get the same gene lists. However, They got different lists. Does anyone konw the reason? Are there anything wrong in the scripts?

Wish your help! Thanks a bunch! I really appreciate it.

Best, Mei
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20120913/ae8267d9/attachment.html>


More information about the Dev mailing list