From 7e7ae6438f780af3634762ea056fcfa7084d7610 Mon Sep 17 00:00:00 2001
From: Dan Staines <dstaines@ebi.ac.uk>
Date: Thu, 22 Mar 2012 14:59:44 +0000
Subject: [PATCH] fixed problem where alternative translations could not be
 retrieved by dbID

---
 modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
index 8bb1b27887..528e0b86cc 100644
--- a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
+++ b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
@@ -659,12 +659,12 @@ sub fetch_by_dbID {
   if ( defined($transcript) ) {
     my $translation = $self->fetch_by_Transcript($transcript);
 
-    if ( defined($translation) ) {
+    if ( defined($translation) && $translation->dbID()==$dbID ) {
       return $translation;
     }
 
     my @alt_translations =
-      @{ $self->fetch_all_by_Transcript($transcript) };
+      @{ $self->fetch_all_alternative_by_Transcript($transcript) };
 
     foreach my $alt_translation (@alt_translations) {
       if ( $alt_translation->dbID() == $dbID ) {
-- 
GitLab