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
e6a50432
Commit
e6a50432
authored
12 years ago
by
Magali Ruffier
Browse files
Options
Downloads
Patches
Plain Diff
check length before coord_system
for coord_system, check rank and name
parent
545d3b05
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/update_mapping_set.pl
+25
-16
25 additions, 16 deletions
misc-scripts/update_mapping_set.pl
with
25 additions
and
16 deletions
misc-scripts/update_mapping_set.pl
+
25
−
16
View file @
e6a50432
...
...
@@ -188,22 +188,30 @@ foreach my $h ($host,$host2) {
if
(
!
defined
$current_name_hash
)
{
next
;
}
foreach
my
$
coord_system_id
(
keys
%
{
$old_name_hash
}){
my
$current_
cs
_hash
=
$current_name_hash
->
{
$
coord_system_id
};
my
$old_
cs
_hash
=
$old_name_hash
->
{
$
coord_system_id
};
# The
coord_system might have been removed in the current database
if
(
!
defined
$current_
cs
_hash
)
{
foreach
my
$
length
(
keys
%
{
$old_name_hash
}){
my
$current_
length
_hash
=
$current_name_hash
->
{
$
length
};
my
$old_
length
_hash
=
$old_name_hash
->
{
$
length
};
# The
seq_region might have a different length
if
(
!
defined
$current_
length
_hash
)
{
next
;
}
foreach
my
$
length
(
keys
%
{
$old_
cs
_hash
})
{
my
$current_
id
=
$current_
cs
_hash
->
{
$
length
};
my
$old_
id
=
$old_
cs
_hash
->
{
$
length
};
#
If no change, no need to write out
if
(
!
defined
$current_
id
||
$old_id
==
$current_id
)
{
foreach
my
$
cs
(
keys
%
{
$old_
length
_hash
})
{
my
$current_
cs_hash
=
$current_
length
_hash
->
{
$
cs
};
my
$old_
cs_hash
=
$old_
length
_hash
->
{
$
cs
};
#
The coord system might have changed
if
(
!
defined
$current_
cs_hash
)
{
next
;
}
$sth_seq_mapping
->
execute
(
$old_id
,
$current_id
,
$mapping_set_id
)
unless
$dry_run
;
$count
++
;
foreach
my
$id
(
keys
%
{
$old_cs_hash
})
{
my
$current_id
=
$current_cs_hash
->
{
$id
};
my
$old_id
=
$old_cs_hash
->
{
$id
};
# If no change, no need to write out
if
(
!
defined
$current_id
||
$old_id
==
$current_id
)
{
next
;
}
$sth_seq_mapping
->
execute
(
$old_id
,
$current_id
,
$mapping_set_id
)
unless
$dry_run
;
$count
++
;
}
}
}
}
...
...
@@ -216,15 +224,16 @@ sub read_seq_region{
my
$dbh
=
shift
;
my
$dbname
=
shift
;
my
%seq_region_hash
;
my
(
$seq_region_id
,
$seq_region_name
,
$coord_system_id
,
$length
,
$cs_name
);
my
$sth
=
$dbh
->
prepare
("
SELECT seq_region_id, name, length, c
oord_system_id
FROM
$dbname
.seq_region
");
my
(
$seq_region_id
,
$seq_region_name
,
$coord_system_id
,
$length
,
$cs_name
,
$cs_rank
);
my
$sth
=
$dbh
->
prepare
("
SELECT seq_region_id,
s.
name, length, c
s.name, cs.rank
FROM
$dbname
.seq_region
s,
$dbname
.coord_system cs WHERE cs.coord_system_id = s.coord_system_id
");
$sth
->
execute
();
$sth
->
bind_col
(
1
,
\
$seq_region_id
);
$sth
->
bind_col
(
2
,
\
$seq_region_name
);
$sth
->
bind_col
(
3
,
\
$length
);
$sth
->
bind_col
(
4
,
\
$coord_system_id
);
$sth
->
bind_col
(
4
,
\
$cs_name
);
$sth
->
bind_col
(
5
,
\
$cs_rank
);
while
(
$sth
->
fetch
){
$seq_region_hash
{
$seq_region_name
}{
$
coord_system_id
}{
$length
}
=
$seq_region_id
;
$seq_region_hash
{
$seq_region_name
}{
$
length
}{
$cs_name
}{
$cs_rank
}
=
$seq_region_id
;
}
return
\
%seq_region_hash
;
}
...
...
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