Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
bbb06d2f
Commit
bbb06d2f
authored
17 years ago
by
Patrick Meidl
Browse files
Options
Downloads
Patches
Plain Diff
moved internal_id_rescore() here from GeneScoreBuilder (for reuse by TranscriptScoreBuilder)
parent
bd159b30
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/IdMapping/ScoreBuilder.pm
+52
-1
52 additions, 1 deletion
modules/Bio/EnsEMBL/IdMapping/ScoreBuilder.pm
with
52 additions
and
1 deletion
modules/Bio/EnsEMBL/IdMapping/ScoreBuilder.pm
+
52
−
1
View file @
bbb06d2f
...
...
@@ -37,8 +37,10 @@ use Bio::EnsEMBL::IdMapping::BaseObject;
our
@ISA
=
qw(Bio::EnsEMBL::IdMapping::BaseObject)
;
use
Bio::EnsEMBL::Utils::
Exception
qw(throw warning)
;
use
Bio::EnsEMBL::Utils::
ScriptUtils
qw(path_append)
;
use
Bio::EnsEMBL::IdMapping::
ScoredMappingMatrix
;
#
# create a shrinked matrix which doesn't contain entries which were already
# mapped
...
...
@@ -62,8 +64,10 @@ sub create_shrinked_matrix {
throw
('
Need a cache file name.
')
unless
(
$cache_file
);
my
$dump_path
=
path_append
(
$self
->
conf
->
param
('
dumppath
'),
'
matrix
');
my
$shrinked_matrix
=
Bio::EnsEMBL::IdMapping::
ScoredMappingMatrix
->
new
(
-
DUMP_PATH
=>
$
self
->
conf
->
param
('
dumppath
')
,
-
DUMP_PATH
=>
$dump
_
path
,
-
CACHE_FILE
=>
$cache_file
,
);
...
...
@@ -95,6 +99,53 @@ sub create_shrinked_matrix {
}
sub
internal_id_rescore
{
my
$self
=
shift
;
my
$matrix
=
shift
;
unless
(
$matrix
and
$matrix
->
isa
('
Bio::EnsEMBL::IdMapping::ScoredMappingMatrix
'))
{
throw
('
Need a Bio::EnsEMBL::IdMapping::ScoredMappingMatrix.
');
}
my
$i
=
0
;
foreach
my
$source
(
@
{
$matrix
->
get_all_sources
})
{
my
@entries
=
sort
{
$b
<=>
$a
}
@
{
$matrix
->
get_Entries_for_source
(
$source
)
};
# nothing to do if we only have one mapping
next
unless
(
scalar
(
@entries
)
>
1
);
# only penalise if mappings are ambiguous
next
unless
(
$entries
[
0
]
->
score
==
$entries
[
1
]
->
score
);
# only penalise if one source id == target id where score == best score
my
$ambiguous
=
0
;
foreach
my
$e
(
@entries
)
{
if
(
$e
->
target
==
$source
and
$e
->
score
==
$entries
[
0
])
{
$ambiguous
=
1
;
}
}
next
unless
(
$ambiguous
);
# now penalise those where source id != target id and score == best score
foreach
my
$e
(
@entries
)
{
if
(
$e
->
target
!=
$source
and
$e
->
score
==
$entries
[
0
])
{
$matrix
->
set_score
(
$source
,
$e
->
target
,
(
$e
->
score
*
0.8
));
$i
++
;
}
}
}
$self
->
logger
->
debug
("
Scored entries with internal ID mismatch:
$i
\n
",
1
);
}
sub
log_matrix_stats
{
my
$self
=
shift
;
my
$matrix
=
shift
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment