3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
23 Please email comments or questions to the
public Ensembl
24 developers list at <http:
26 Questions may also be sent to the Ensembl help desk at
44 package Bio::EnsEMBL::IdMapping::InternalIdMapper::EnsemblGeneGeneric;
48 no warnings
'uninitialized';
65 my $gene_scores = shift;
67 $self->logger->info(
"Basic gene mapping...\n", 0,
'stamped');
69 $mappings = $self->basic_mapping($gene_scores,
"gene_mappings$num");
71 my $new_scores = $gsb->create_shrinked_matrix($gene_scores, $mappings,
74 return ($new_scores, $mappings);
79 # build the synteny from unambiguous mappings
86 my $gene_scores = shift;
88 unless ($gene_scores->loaded) {
89 $self->logger->info(
"Synteny Framework building...\n", 0,
'stamped');
90 my $dump_path = path_append($self->conf->param(
'basedir'),
'mapping');
92 -DUMP_PATH => $dump_path,
93 -CACHE_FILE =>
'synteny_framework.ser',
94 -LOGGER => $self->logger,
96 -CACHE => $self->cache,
100 # use it to rescore the genes
101 $self->logger->info(
"\nSynteny assisted mapping...\n", 0,
'stamped');
102 $gene_scores = $sf->rescore_gene_matrix_lsf($gene_scores);
105 $gene_scores->write_to_file;
108 my $new_mappings = $self->basic_mapping($gene_scores,
"gene_mappings$num");
110 my $new_scores = $gsb->create_shrinked_matrix($gene_scores, $new_mappings,
113 return ($new_scores, $new_mappings);
118 # rescore with simple scoring function and try again
120 sub best_transcript {
124 my $mappings = shift;
125 my $gene_scores = shift;
126 my $transcript_scores = shift;
128 $self->logger->info(
"Retry with simple best transcript score...\n", 0,
'stamped');
130 unless ($gene_scores->loaded) {
131 $gsb->simple_gene_rescore($gene_scores, $transcript_scores);
132 $gene_scores->write_to_file;
135 my $new_mappings = $self->basic_mapping($gene_scores,
"gene_mappings$num");
137 my $new_scores = $gsb->create_shrinked_matrix($gene_scores, $new_mappings,
140 return ($new_scores, $new_mappings);
145 # rescore by penalising scores between genes with different biotypes
151 my $mappings = shift;
152 my $gene_scores = shift;
154 $self->logger->info(
"Retry with biotype disambiguation...\n", 0,
'stamped');
156 unless ($gene_scores->loaded) {
157 $gsb->biotype_gene_rescore($gene_scores);
158 $gene_scores->write_to_file;
161 my $new_mappings = $self->basic_mapping($gene_scores,
"gene_mappings$num");
163 my $new_scores = $gsb->create_shrinked_matrix($gene_scores, $new_mappings,
166 return ($new_scores, $new_mappings);
173 my $mappings = shift;
174 my $gene_scores = shift;
176 $self->logger->info(
"Retry with location disambiguation...\n", 0,
'stamped');
178 unless ($gene_scores->loaded) {
179 $gsb->location_gene_rescore($gene_scores);
180 $gene_scores->write_to_file;
183 my $new_mappings = $self->basic_mapping($gene_scores,
"gene_mappings$num");
185 my $new_scores = $gsb->create_shrinked_matrix($gene_scores, $new_mappings,
188 return ($new_scores, $new_mappings);
194 # selectively rescore by penalising scores between genes with different
201 my $mappings = shift;
202 my $gene_scores = shift;
204 $self->logger->info(
"Retry with internalID disambiguation...\n", 0,
'stamped');
206 unless ($gene_scores->loaded) {
207 $gsb->internal_id_rescore($gene_scores);
208 $gene_scores->write_to_file;
211 my $new_mappings = $self->basic_mapping($gene_scores,
"gene_mappings$num");
213 my $new_scores = $gsb->create_shrinked_matrix($gene_scores, $new_mappings,
216 return ($new_scores, $new_mappings);