From 3723688400cff8ed204a30df756c68495da79653 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20Kusalananda=20K=C3=A4h=C3=A4ri?=
 <ak4@sanger.ac.uk>
Date: Wed, 19 Oct 2011 16:41:34 +0000
Subject: [PATCH] Implement biotype() based on the method with the same name in
 EnsemblGeneGeneric.pm

---
 .../EnsemblTranscriptGeneric.pm               | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper/EnsemblTranscriptGeneric.pm b/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper/EnsemblTranscriptGeneric.pm
index 32bbc14f5a..cdfa0af9a1 100644
--- a/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper/EnsemblTranscriptGeneric.pm
+++ b/modules/Bio/EnsEMBL/IdMapping/InternalIdMapper/EnsemblTranscriptGeneric.pm
@@ -119,6 +119,33 @@ sub mapped_gene {
   return ($new_scores, $mappings);
 }
 
+#
+# rescore by penalising scores between transcripts with different biotypes
+#
+sub biotype {
+  my $self              = shift;
+  my $num               = shift;
+  my $tsb               = shift;
+  my $mappings          = shift;
+  my $transcript_scores = shift;
+
+  $self->logger->info( "Retry with biotype disambiguation...\n",
+                       0, 'stamped' );
+
+  unless ( $transcript_scores->loaded() ) {
+    $tsb->biotype_transcript_rescore($transcript_scores);
+    $transcript_scores->write_to_file();
+  }
+
+  my $new_mappings = $self->basic_mapping( $transcript_scores,
+                                           "transcript_mappings$num" );
+  $num++;
+  my $new_scores =
+    $tsb->create_shrinked_matrix( $transcript_scores, $new_mappings,
+                                  "transcript_matrix$num" );
+
+  return ( $new_scores, $new_mappings );
+}
 
 #
 # selectively rescore by penalising scores between transcripts with
-- 
GitLab