[ensembl-dev] Extracting all GOslim-goa (or GO) annotations for every ENSG.

mr6 at ebi.ac.uk mr6 at ebi.ac.uk
Fri Jul 5 11:52:43 BST 2013


Hi Elena,

If you look at the documentation for the 'get_all_object_xrefs' method, it
says 'Retrieves xrefs for this gene.  This does *not* include xrefs that
are associated with the transcripts or corresponding translations of this
gene'

On the other hand, for the sql query you are running, the object xref is
linked via the translation id corresponding to the gene, not the gene
itself.

More generally, go xrefs are linked to translations, as they are
describing biological functions and the like specific to a protein, not a
genomic location.

Using the API, the call $gene->get_all_DBLinks('goslim_goa') should return
all xrefs of external db goslim_goa associated to a given gene and its
transcripts and translations.

If you are also interested in the whole ontology graphs, you can make use
of the OntologyTermAdaptor.
For a given ontology accession, which you would get as a result of the
previous calls, you can use fetch_all_by_parent_term or
fetch_all_by_children_term.


Hope this helps.


Regards,
Magali

> Hello, I've looked around in the mailing list and I did not find any
> answer (or old ones not working anymore with the new APIs,
> like http://lists.ensembl.org/ensembl-dev/msg03089.html).
> I would like to extract all the GOslim-goa terms associated to all the
> human ENSG, also considering the annotations derived from the
> ontology graph (ie if termA is an ancestor of termB and gene1 is
> associated with termB I would like to also get the association
> gene1-termA).
>
> I've tried with the perl API's (version 72) but without luck, the
> relevant portion of the code is:
>
> foreach my $gene (@$genes) {
>
> print_DBEntries($gene->get_all_object_xrefs("goslim_goa",12700),
> $gene->stable_id());
>         }
>
> sub print_DBEntries
> {
>     my $db_entries = shift;
>     my $gene = shift;
>
>     foreach my $dbe ( @{$db_entries} ) {
>         print STDERR $dbe->dbname() . "\n";
>         #if ($dbe->dbname()  =~ /^goslim_goa/i) {
>                 print $gene . "\t" . $dbe->display_id() . "\t" .
> $dbe->description() . "\n";
>         #}
>     }
> }
>
> but this does not print anything (I tried removing the parameters in
> get_all_object_xrefs with no luck...I did not
> see any dbe->dbname() that resembles GO when I printed all found
> xrefs...).
> What puzzles me is that this SQL query works (ok, it is giving me
> duplicates but I don't mind at this point):
>
> mysql> select g.stable_id,x.dbprimary_acc,x.description from xref as
> x, object_xref as o, transcript as t, translation as tr, gene as g
> where  x.external_db_id = "12700" AND o.xref_id=x.xref_id and
> g.gene_id = t.gene_id AND t.transcript_id = tr.transcript_id AND
> tr.translation_id = o.ensembl_id;
>
> Right now I would like to know what I'm missing about the perl API and
> if the results gotten with this SQL query are what I need
> in term of graph traversal (it seems so looking at the data but I
> would like to be sure).
>
> Thank you very much for your help (and the tightly normalized DB with
> some exceptions that spared me another join :) ).
> E.
>
> --
> $ pom
>
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info:
> http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
>





More information about the Dev mailing list