From c75f8546b4129da166b382ce99dc784cfd4a304b Mon Sep 17 00:00:00 2001
From: Magali Ruffier <mr6@ebi.ac.uk>
Date: Thu, 2 May 2013 09:38:23 +0000
Subject: [PATCH] ENSCORESW-62: updated call to mapped_transcript was giving it
 an exon mapping list where a transcript mapping list was required

---
 modules/Bio/EnsEMBL/IdMapping/InternalIdMapper.pm             | 3 ++-
 .../EnsEMBL/IdMapping/InternalIdMapper/EnsemblExonGeneric.pm  | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper.pm b/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper.pm
index 741a0f0bc9..8d59e5d960 100644
--- a/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper.pm
+++ b/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper.pm
@@ -317,7 +317,7 @@ sub map_exons {
     #
     foreach my $plugin (@plugins) {
       ($exon_scores, $new_mappings) = $self->delegate_to_plugin($plugin, $i++,
-        $esb, $new_mappings, $exon_scores);
+        $esb, $new_mappings, $exon_scores, $transcript_mappings);
 
       push(@mappings, $new_mappings);
     }
@@ -642,6 +642,7 @@ sub write_ambiguous {
       print $fh "\n    " unless (($i++)%10);
       print $fh $e->$other_db_type, ", ";
     }
+    print $fh "\n";
   }
 
   print $fh "\n";
diff --git a/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper/EnsemblExonGeneric.pm b/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper/EnsemblExonGeneric.pm
index f4228072f1..8f820e497a 100644
--- a/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper/EnsemblExonGeneric.pm
+++ b/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper/EnsemblExonGeneric.pm
@@ -64,6 +64,7 @@ sub init_basic {
 #
 # reduce score for mappings of exons which do not belong to mapped
 # transcripts
+# (ie where source exon transcript does not map target exon transcript)
 #
 sub mapped_transcript {
   my $self = shift;
@@ -71,11 +72,12 @@ sub mapped_transcript {
   my $esb = shift;
   my $mappings = shift;
   my $exon_scores = shift;
+  my $transcript_mappings = shift;
 
   $self->logger->info("Exons in mapped transcript...\n", 0, 'stamped');
 
   unless ($exon_scores->loaded) {
-    $esb->non_mapped_transcript_rescore($exon_scores, $mappings);
+    $esb->non_mapped_transcript_rescore($exon_scores, $transcript_mappings);
     $exon_scores->write_to_file;
   }
 
-- 
GitLab