![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
gene names from Ensembl | papori | Bioinformatics | 7 | 01-22-2013 11:38 AM |
gene ontology | ssing | Bioinformatics | 1 | 02-22-2012 04:24 AM |
gene ontology over-representation of differentially expressed genes | damiankao | Bioinformatics | 10 | 10-20-2011 01:57 PM |
window cutoff for nearest gene (gene ontology) | repinementer | Bioinformatics | 1 | 11-22-2010 04:40 PM |
High throughput Gene Ontology enrichment API | ieuanclay | Bioinformatics | 3 | 08-23-2010 06:23 AM |
![]() |
|
Thread Tools |
![]() |
#1 |
Junior Member
Location: Minnesota Join Date: Jan 2012
Posts: 1
|
![]()
Hi,
I was working on some scripts that uses Ensembl perl API to pull out newest gene build and associated annotations. However, I went into trouble when trying to retrieve gene ontology annotations associated to genes. I know you can easily have this done using BioMart in Ensembl (external references in attributes), but seems tricky to me to achieve this by perl API. Anyone got any ideas? Thanks in advance. Bin |
![]() |
![]() |
![]() |
#2 |
Moderator
Location: Oslo, Norway Join Date: Nov 2008
Posts: 415
|
![]()
Here is a quick copy and paste from an old script that may help or at least get you started:
Code:
# GET THE GENE ADAPTOR FOR THIS DATABASE my $ga = $dba->get_GeneAdaptor() ; # GET THE ONTOLOGY ADAPTOR FOR THIS DATABASE #my $go = $dba->get_OntologyAdaptor() ; # GET THE TRANSLATION ADAPTOR FOR THIS DATABASE my $tra = $dba->get_TranslationAdaptor() ; # Get all genes my @genes = @{$ga->fetch_all_by_biotype('protein_coding') }; # Loop through genes my %seen; # prevent duplicates foreach my $gene (@genes) { my $header = ">".$gene->stable_id(); # ensembl ID my @db_links=( $gene->get_all_DBLinks() ); my $db_entries = shift @db_links; foreach my $dbe ( @{$db_entries} ) { my $out="$header\t".$dbe->display_id()." ".$dbe->description."\n" if $dbe->dbname() eq "GO"; if ($out){ $seen{$out}=1; print $out; } } } |
![]() |
![]() |
![]() |
Tags |
api, ensembl, gene ontology, perl |
Thread Tools | |
|
|