From 9c894fca24bd2c45086c2e3fb1969bc89c8fd06f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20Kusalananda=20K=C3=A4h=C3=A4ri?=
 <ak4@sanger.ac.uk>
Date: Wed, 13 Jun 2012 11:01:11 +0000
Subject: [PATCH] Translation stable ID version incrementation only dependent
 on translated sequence, not transcript sequence.

---
 .../StableIdGenerator/EnsemblGeneric.pm          | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/modules/Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm b/modules/Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm
index f7738ed821..f72b49e733 100644
--- a/modules/Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm
+++ b/modules/Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm
@@ -255,7 +255,7 @@ sub is_valid {
                 genes, the rules for incrementing the version number are:
                     - exons: if exon sequence changed
                     - transcript: if spliced exon sequence changed
-                    - translation: if transcript or translation changed
+                    - translation: if translated sequence changed
                     - gene: if any of its transcript changed
   Return type : String - the version to be used
   Exceptions  : thrown on wrong argument
@@ -280,19 +280,7 @@ sub calculate_version {
   }
   elsif ( $s_obj->isa('Bio::EnsEMBL::IdMapping::TinyTranslation') ) {
     # increment version if transcript or translation sequences changed
-
-    my $s_tr =
-      $self->cache->get_by_key( 'transcripts_by_id', 'source',
-                                $s_obj->transcript_id() );
-    my $t_tr =
-      $self->cache->get_by_key( 'transcripts_by_id', 'target',
-                                $t_obj->transcript_id() );
-
-    if ( $s_tr->seq_md5_sum() ne $t_tr->seq_md5_sum() ||
-         $s_obj->seq() ne $t_obj->seq() )
-    {
-      ++$version;
-    }
+    if ( $s_obj->seq() ne $t_obj->seq() ) { ++$version }
   }
   elsif ( $s_obj->isa('Bio::EnsEMBL::IdMapping::TinyGene') ) {
     # increment version if any transcript changed
-- 
GitLab