I am using a Homology adaptor:
my $homology_adaptor = Bio::EnsEMBL::Registry->get_adaptor('Multi', 'compara', 'Homology');
my $homologies = $homology_adaptor->fetch_all_by_Member($gene_member);
which in when I loop through:
foreach my $homology (@{$homologies}) {
my $member=${$homology->get_all_Members}[1];​
Does not always return a member description:
$member->description​
But does return an protein ID. I am wondering what is the best way to get the gene id from the protein id using the Ensembl API.
I was trying to do something similar, convert GeneID to Gene Symbol. I was doing this for a large amount of genes and found it to be quite slow using the api. I had much more success downloading a TSV file from the UCSC Genome Browser, provided what your looking for is in there.
If you select the selected fields from primary and related tables option in the output format, you should be able to get the information you want in a text file, which you can either read into memory or store in mysql or something.
Hope this helps!
-Kyle