[ensembl-dev] How to get the GO evidence code and qualifier

James Allen jallen at ebi.ac.uk
Fri Sep 14 13:52:22 BST 2012


Hello,
The evidence codes as they relate to a particular species are stored in the ontology_xref table of that species' core database. When external links are retrieved via the API, if there is a relevant entry in this table then the 'DBEntry' object is actually an OntologyXref object (http://www.ensembl.org/info/docs/Doxygen/core-api/classBio_1_1EnsEMBL_1_1OntologyXref.html). This has a method, get_all_linkage_types, which returns an arrayref of the evidence codes. (Code example at bottom of email.) Currently, the NOT qualifiers are not stored; there may be support for annotation extensions and qualifiers in future releases of EnsemblGenomes, but there is no definite time frame for this.

In your earlier question to the list your example used D. melanogaster. If this question also relates to fruitfly, then please note that the evidence codes will be incomplete in the current version of Ensembl: sometimes they are absent, and in cases where a single GO term is supported by multiple evidence codes, only one (randomly selected) is stored. This will be fixed in the next EnsemblGenomes release (16) in October, and then subsequently in Ensembl 70 in the new year. In the meantime, if you require complete information (including the NOT annotations) for melanogaster, this is available from the Gene Ontology site: http://www.geneontology.org/gene-associations/gene_association.fb.gz. The ID in the second column of that file is the same as the Ensembl stable_id; let me know if you need any assitance in parsing the file.

Cheers,
James


# Lookup GO terms associated with a gene, and retrieve evidence codes 

use Bio::EnsEMBL::Registry;

my %genelist;

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

for my $gene (@{$gene_adaptor->fetch_all}) {
    my @db_links = @{$gene->get_all_DBLinks('GO')};
    for my $dbe (@db_links){
        my $gene_name=$gene->stable_id();
        my $go_name=$dbe->display_id();
        if ((ref $dbe) =~ /OntologyXref/) {
            $genelist{$gene_name}{$go_name} = $dbe->get_all_linkage_types();
        } else {
            # Every GO term _should_ have at least one linkage type.
            # For fruitfly this is a known problem with a fix on the way...
            print STDERR "Missing linkage for $gene_name, $go_name\n";
        }
     }
}



On Fri, 14 Sep 2012 08:29:53 +0800
JiangMei <gingerplum at hotmail.com> wrote:

> 
> Hi All.
> 
> Does anyone know how to get the GO evidence code, such as IDA (Inferred from direct assay), or qualifier, such as NOT? Did Ensembl API store these GO
> information?
> 
> Wish your help! Thanks a bunch!
> 
> 
> Best, Mei
>  		 	   		  




More information about the Dev mailing list