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
90603ccc
Commit
90603ccc
authored
12 years ago
by
Magali Ruffier
Browse files
Options
Downloads
Patches
Plain Diff
if assembly has changed between two releases, skip database completely (no mapping required)
password is not always required
parent
205bf2f5
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
+12
-2
12 additions, 2 deletions
misc-scripts/update_mapping_set.pl
with
12 additions
and
2 deletions
misc-scripts/update_mapping_set.pl
+
12
−
2
View file @
90603ccc
...
...
@@ -125,7 +125,6 @@ GetOptions('host=s' => \$host,
pod2usage
(
1
)
if
(
$help
);
throw
("
--user argument required
")
if
(
!
defined
(
$user
));
throw
("
--pass argument required
")
if
(
!
defined
(
$pass
));
throw
("
--release argument required
")
if
(
!
defined
(
$release
));
my
$database
=
'
information_schema
';
...
...
@@ -152,6 +151,10 @@ foreach my $h ($host,$host2) {
my
$schema_build
;
foreach
my
$db_name
(
@
{
$dbs
}){
print
STDERR
"
Going to update mapping for
$db_name
->[0]....
\n
";
my
$current_assembly
=
get_assembly
(
$dbh
,
$db_name
->
[
0
])
;
my
$previous_dbname
=
&get_previous_dbname
(
$old_dbh
,
$db_name
->
[
0
],
$release
);
my
$old_assembly
=
get_assembly
(
$old_dbh
,
$previous_dbname
);
if
(
$old_assembly
ne
$current_assembly
)
{
next
;
}
my
$mapping_set_id
;
my
$current_seq_region
=
();
# hash containing the relation seq_region_name->seq_region_id for the current database
my
$old_seq_region
=
();
#hash containing the previous database relation seq_region_name->seq_region_id
...
...
@@ -177,7 +180,6 @@ foreach my $h ($host,$host2) {
elsif
(
$status
==
NEW_MAPPING
){
$sth_mapping_set
->
execute
(
$mapping_set_id
,
$schema_build
)
unless
$dry_run
;
#there has been a seq_region change between releases, add a new mapping_set and the relation old_seq_region_id->new_seq_region_id
my
$previous_dbname
=
&get_previous_dbname
(
$old_dbh
,
$db_name
->
[
0
],
$release
);
$current_seq_region
=
&read_seq_region
(
$dbh
,
$db_name
->
[
0
]);
$old_seq_region
=
&read_seq_region
(
$old_dbh
,
$previous_dbname
);
#update the seq_region_mapping table with the old->new seq_region_id relation
...
...
@@ -317,3 +319,11 @@ sub get_schema_and_build{
my
@dbname
=
split
/_/
,
$dbname
;
return
join
"
_
",
$dbname
[(
$#dbname
-
1
)],
$dbname
[(
$#dbname
)];
}
sub
get_assembly
{
my
(
$dbh
,
$dbname
)
=
@_
;
my
$sth
=
$dbh
->
prepare
("
select meta_value from
$dbname
.meta where meta_key = 'assembly.default'
");
$sth
->
execute
();
return
$sth
->
fetchrow
();
}
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