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

Kiran Mukhyala mukhyala.kiran at gene.com
Wed Sep 14 17:55:37 BST 2011


Hi Gonzalo,

How about using UniProt BioMart to figure out the species first and then use
the species information to connect to Ensembl.

Here's an example<http://www.ebi.ac.uk/uniprot/biomart/martview?VIRTUALSCHEMANAME=default&ATTRIBUTES=uniprot.default.features.accession%7Cuniprot.default.features.organism&FILTERS=uniprot.default.filters.accession.%22P00533%22&VISIBLEPANEL=resultspanel>UniProt
BioMart query that returns the species name using a UniProt
accession:

http://www.ebi.ac.uk/uniprot/biomart/martview?VIRTUALSCHEMANAME=default&ATTRIBUTES=uniprot.default.features.accession|uniprot.default.features.organism&FILTERS=uniprot.default.filters.accession."P00533"&VISIBLEPANEL=resultspanel


Here's BioMart query in XML, you can of course use the BioMart Perl API.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Query>
<Query  virtualSchemaName = "default" formatter = "TSV" header = "0"
uniqueRows = "0" count = "" datasetConfigVersion = "0.6" >
			
	<Dataset name = "uniprot" interface = "default" >
		<Filter name = "accession" value = "P00533"/>
		<Attribute name = "accession" />
		<Attribute name = "organism" />
	</Dataset>
</Query>


Hope that helps,
-Kiran




On Tue, Sep 13, 2011 at 3:57 PM, Gonzalo Parra <gonza_parra at hotmail.com>wrote:

>  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
>
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> List admin (including subscribe/unsubscribe):
> http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20110914/c55de804/attachment.html>


More information about the Dev mailing list