[ensembl-dev] Converting Uniprot IDs to ensembl ID

ian Longden ianl at ebi.ac.uk
Mon Nov 28 13:52:29 GMT 2011


Do you know which species each of these is from. If so the easiest
thing to do is to use Biomart for each species. (if there are only a
few species).
Alternatively (if this is a lot of species, but you still need to know
what this is)
then you can use the API

So if we pretend we have a list of acc and species in a file

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

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

while(<>){
  my ($acc, $species) = split;

  my $adap = $reg->get_adaptor($species,"core","translation");

  my @trans = @{$adap->fetch_all_by_external_name($acc,"uniprot%")};

  foreach my $translation (@trans){
    print $translation->stable_id."\t".$acc."\n";
  }
}


Please note i have not ran this code or compiled it or checked it,
this is just a brief outline. But it looks okay to me.

-Ian.

On Mon, Nov 28, 2011 at 1:15 PM, James Blackshaw
<jab250 at mrc-mbu.cam.ac.uk> wrote:
> Hi,
> I've been trying to convert some large (~70 000) lists of identifiers from
> Uniprot accession numbers to their relevant Ensembl IDs. is there any way to
> easily do this with the Ensembl API, as the Uniprot mapper is having a very
> low success rate.
>
> Regards,
> James Blackshaw
> PhD Student
> MRC MBU
>
> _______________________________________________
> 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/
>




More information about the Dev mailing list