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
81d266f5
Commit
81d266f5
authored
20 years ago
by
Glenn Proctor
Browse files
Options
Downloads
Patches
Plain Diff
Fix to xref output duplicate filtering.
parent
d83da7fb
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
+10
-9
10 additions, 9 deletions
misc-scripts/xref_mapping/XrefMapper/BasicMapper.pm
with
10 additions
and
9 deletions
misc-scripts/xref_mapping/XrefMapper/BasicMapper.pm
+
10
−
9
View file @
81d266f5
...
...
@@ -926,6 +926,10 @@ sub dump_core_xrefs {
# execute several queries with a max of 200 entries in each IN clause - more efficient
my
$batch_size
=
200
;
# keep track of what xref_ids have been written to prevent duplicates; e.g. several dependent
# xrefs my be dependent on the same master xref.
my
%xrefs_written
;
while
(
@xref_ids
)
{
my
@ids
;
...
...
@@ -950,20 +954,17 @@ sub dump_core_xrefs {
my
(
$xref_id
,
$accession
,
$version
,
$label
,
$description
,
$source_id
,
$species_id
,
$master_xref_id
);
$xref_sth
->
bind_columns
(
\
$xref_id
,
\
$accession
,
\
$version
,
\
$label
,
\
$description
,
\
$source_id
,
\
$species_id
);
# keep track of what xref_ids have been written to prevent duplicates; e.g. several dependent
# xrefs my be dependent on the same master xref.
my
%xrefs_written
;
# note the xref_id we write to the file is NOT the one we've just read
# from the internal xref database as the ID may already exist in the
# core database so we add on $xref_id_offset
while
(
$xref_sth
->
fetch
())
{
my
$external_db_id
=
$source_to_external_db
{
$source_id
};
print
XREF
(
$xref_id
+
$xref_id_offset
)
.
"
\t
"
.
$external_db_id
.
"
\t
"
.
$accession
.
"
\t
"
.
$label
.
"
\t
"
.
$version
.
"
\t
"
.
$description
.
"
\n
";
$xrefs_written
{
$xref_id
}
=
1
;
$source_ids
{
$source_id
}
=
$source_id
;
if
(
!
$xrefs_written
{
$xref_id
})
{
my
$external_db_id
=
$source_to_external_db
{
$source_id
};
print
XREF
(
$xref_id
+
$xref_id_offset
)
.
"
\t
"
.
$external_db_id
.
"
\t
"
.
$accession
.
"
\t
"
.
$label
.
"
\t
"
.
$version
.
"
\t
"
.
$description
.
"
\n
";
$xrefs_written
{
$xref_id
}
=
1
;
$source_ids
{
$source_id
}
=
$source_id
;
}
}
# Now get the dependent xrefs for each of these xrefs and write them as well
...
...
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