0
|
1 =head1 LICENSE
|
|
2
|
|
3 Copyright (c) 1999-2012 The European Bioinformatics Institute and
|
|
4 Genome Research Limited. All rights reserved.
|
|
5
|
|
6 This software is distributed under a modified Apache license.
|
|
7 For license details, please see
|
|
8
|
|
9 http://www.ensembl.org/info/about/code_licence.html
|
|
10
|
|
11 =head1 CONTACT
|
|
12
|
|
13 Please email comments or questions to the public Ensembl
|
|
14 developers list at <dev@ensembl.org>.
|
|
15
|
|
16 Questions may also be sent to the Ensembl help desk at
|
|
17 <helpdesk@ensembl.org>.
|
|
18
|
|
19 =cut
|
|
20
|
|
21 =head1 NAME
|
|
22
|
|
23 =head1 SYNOPSIS
|
|
24
|
|
25 =head1 DESCRIPTION
|
|
26
|
|
27 =head1 METHODS
|
|
28
|
|
29 =cut
|
|
30
|
|
31 package Bio::EnsEMBL::IdMapping::InternalIdMapper::EnsemblExonGeneric;
|
|
32
|
|
33 use strict;
|
|
34 use warnings;
|
|
35 no warnings 'uninitialized';
|
|
36
|
|
37 use Bio::EnsEMBL::IdMapping::InternalIdMapper::BaseMapper;
|
|
38 our @ISA = qw(Bio::EnsEMBL::IdMapping::InternalIdMapper::BaseMapper);
|
|
39
|
|
40 use Bio::EnsEMBL::Utils::Exception qw(throw warning);
|
|
41
|
|
42
|
|
43 #
|
|
44 # basic mapping
|
|
45 #
|
|
46 sub init_basic {
|
|
47 my $self = shift;
|
|
48 my $num = shift;
|
|
49 my $esb = shift;
|
|
50 my $mappings = shift;
|
|
51 my $exon_scores = shift;
|
|
52
|
|
53 $self->logger->info("Basic exon mapping...\n", 0, 'stamped');
|
|
54
|
|
55 $mappings = $self->basic_mapping($exon_scores, "exon_mappings$num");
|
|
56 $num++;
|
|
57 my $new_scores = $esb->create_shrinked_matrix($exon_scores, $mappings,
|
|
58 "exon_matrix$num");
|
|
59
|
|
60 return ($new_scores, $mappings);
|
|
61 }
|
|
62
|
|
63
|
|
64 #
|
|
65 # reduce score for mappings of exons which do not belong to mapped
|
|
66 # transcripts
|
|
67 #
|
|
68 sub mapped_transcript {
|
|
69 my $self = shift;
|
|
70 my $num = shift;
|
|
71 my $esb = shift;
|
|
72 my $mappings = shift;
|
|
73 my $exon_scores = shift;
|
|
74
|
|
75 $self->logger->info("Exons in mapped transcript...\n", 0, 'stamped');
|
|
76
|
|
77 unless ($exon_scores->loaded) {
|
|
78 $esb->non_mapped_transcript_rescore($exon_scores, $mappings);
|
|
79 $exon_scores->write_to_file;
|
|
80 }
|
|
81
|
|
82 $mappings = $self->basic_mapping($exon_scores, "exon_mappings$num");
|
|
83 $num++;
|
|
84 my $new_scores = $esb->create_shrinked_matrix($exon_scores, $mappings,
|
|
85 "exon_matrix$num");
|
|
86
|
|
87 return ($new_scores, $mappings);
|
|
88 }
|
|
89
|
|
90
|
|
91 #
|
|
92 # selectively rescore by penalising scores between exons with
|
|
93 # different internalIDs
|
|
94 #
|
|
95 sub internal_id {
|
|
96 my $self = shift;
|
|
97 my $num = shift;
|
|
98 my $esb = shift;
|
|
99 my $mappings = shift;
|
|
100 my $exon_scores = shift;
|
|
101
|
|
102 $self->logger->info( "Retry with internalID disambiguation...\n",
|
|
103 0, 'stamped' );
|
|
104
|
|
105 if ( !$exon_scores->loaded() ) {
|
|
106 $esb->internal_id_rescore($exon_scores);
|
|
107 $exon_scores->write_to_file();
|
|
108 }
|
|
109
|
|
110 $mappings = $self->basic_mapping( $exon_scores, "exon_mappings$num" );
|
|
111 $num++;
|
|
112 my $new_scores =
|
|
113 $esb->create_shrinked_matrix( $exon_scores, $mappings,
|
|
114 "exon_matrix$num" );
|
|
115
|
|
116 return ( $new_scores, $mappings );
|
|
117 }
|
|
118
|
|
119
|
|
120 1;
|
|
121
|