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
620200c3
Commit
620200c3
authored
20 years ago
by
Glenn Proctor
Browse files
Options
Downloads
Patches
Plain Diff
Re-factored gene display xref calculation to make it clearer.
parent
84115d1a
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
misc-scripts/xref_mapping/XrefMapper/BasicMapper.pm
+12
-12
12 additions, 12 deletions
misc-scripts/xref_mapping/XrefMapper/BasicMapper.pm
with
12 additions
and
12 deletions
misc-scripts/xref_mapping/XrefMapper/BasicMapper.pm
+
12
−
12
View file @
620200c3
...
...
@@ -1218,6 +1218,8 @@ sub build_gene_display_xrefs {
open
(
GENE_DX
,
"
>gene_display_xref.sql
");
my
$hit
=
0
;
my
$miss
=
0
;
my
$trans_no_xref
=
0
;
my
$trans_xref
=
0
;
foreach
my
$gene_id
(
keys
%genes_to_transcripts
)
{
my
@transcripts
=
@
{
$genes_to_transcripts
{
$gene_id
}};
...
...
@@ -1226,24 +1228,22 @@ sub build_gene_display_xrefs {
my
$best_xref_priority_idx
=
99999
;
my
$best_transcript_length
=
-
1
;
foreach
my
$transcript_id
(
@transcripts
)
{
next
if
(
!
$transcript_display_xrefs
->
{
$transcript_id
});
if
(
!
$transcript_display_xrefs
->
{
$transcript_id
})
{
#print "No display_xref assigned to transcript $transcript_id\n";
$trans_no_xref
++
;
next
;
}
else
{
$trans_xref
++
;
}
my
(
$xref_id
,
$priority
)
=
split
(
/:/
,
$transcript_display_xrefs
->
{
$transcript_id
});
#print "gene $gene_id orig:" . $transcript_display_xrefs->{$transcript_id} . " xref id: " . $xref_id . " pri " . $priority . "\n";
my
$transcript
=
$ta
->
fetch_by_dbID
(
$transcript_id
);
my
$transcript_length
=
$transcript
->
length
();
if
(
$priority
lt
$best_xref_priority_idx
)
{
#print "greater for gene $gene_id ts length
$transcript_length
bes
t $best_transcript_length
\n";
if
(
(
$priority
lt
$best_xref_priority_idx
)
||
(
$priority
eq
$best_xref_priority_idx
&&
$transcript_length
g
t
$best_transcript_length
))
{
$best_transcript_length
=
$transcript_length
;
$best_xref_priority_idx
=
$priority
;
$best_xref
=
$xref_id
;
}
elsif
(
$priority
eq
$best_xref_priority_idx
)
{
#print "equal for gene $gene_id ts length $transcript_length best $best_transcript_length\n";
if
(
$transcript_length
gt
$best_transcript_length
)
{
$best_transcript_length
=
$transcript_length
;
$best_xref_priority_idx
=
$priority
;
$best_xref
=
$xref_id
;
#print "here, gene $gene_id best xref now $best_xref\n";
}
}
}
...
...
@@ -1259,7 +1259,7 @@ sub build_gene_display_xrefs {
}
close
(
GENE_DX
);
print
"
Transcripts with no xrefs:
$trans_no_xref
with xrefs:
$trans_xref
\n
";
print
"
Wrote
$hit
gene display_xref entries to gene_display_xref.sql
\n
";
print
"
Couldn't find display_xrefs for
$miss
genes
\n
";
...
...
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