[ensembl-dev] Mapping Uniprot IDs to Ensemble Gene IDs

Gonzalo Parra gonza_parra at hotmail.com
Tue Sep 13 23:57:22 BST 2011


Hi All,

I want to map Uniprot IDs to Ensemble Gene IDs. I know how to do it when I know the species where the gene comes from and I do it with this code.

###########################
use strict;
use Bio::EnsEMBL::Registry;

my $reg = "Bio::EnsEMBL::Registry";

$reg->load_registry_from_db(
    -host => 'ensembldb.ensembl.org',
    -user => 'anonymous'
);

my $UniprotID='P04637';

my $ga = $reg->get_adaptor('Homo sapiens', 'core', 'Gene');
my $ma = $reg->get_adaptor('Multi', 'compara', 'Member');

foreach my $gene (@{$ga->fetch_all_by_external_name($UniprotID)}) {
my $member = $ma->fetch_by_source_stable_id('ENSEMBLGENE', $gene->stable_id); 

next unless (defined $member);

print $member->stable_id(), "\n";
}

#####################################

Now well, I have a list of Uniprot IDs from several species and I'd like to know if there is any way to not tell the adaptor what specie the gene is from in the line

"my $ga = $reg->get_adaptor('Homo sapiens', 'core', 'Gene');"

Is there any way to do it generic?

Thanks in advance

Gonzalo
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20110913/2ea4df4d/attachment.html>


More information about the Dev mailing list