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
c7a6e313
Commit
c7a6e313
authored
18 years ago
by
Glenn Proctor
Browse files
Options
Downloads
Patches
Plain Diff
Added ability to write information about whats been projected to a projection_info database.
parent
0c8b950b
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_projection/project_display_xrefs.pl
+71
-5
71 additions, 5 deletions
misc-scripts/xref_projection/project_display_xrefs.pl
with
71 additions
and
5 deletions
misc-scripts/xref_projection/project_display_xrefs.pl
+
71
−
5
View file @
c7a6e313
...
...
@@ -11,7 +11,7 @@ use Bio::EnsEMBL::DBSQL::GeneAdaptor;
my
$method_link_type
=
"
ENSEMBL_ORTHOLOGUES
";
my
(
$conf
,
$compara
,
$from_species
,
@to_multi
,
$print
,
$names
,
$go_terms
,
$delete_names
,
$delete_go_terms
,
$no_backup
,
$full_stats
,
$descriptions
);
my
(
$conf
,
$compara
,
$from_species
,
@to_multi
,
$print
,
$names
,
$go_terms
,
$delete_names
,
$delete_go_terms
,
$no_backup
,
$full_stats
,
$descriptions
,
$release
,
$no_database
);
GetOptions
('
conf=s
'
=>
\
$conf
,
'
compara=s
'
=>
\
$compara
,
...
...
@@ -26,11 +26,38 @@ GetOptions('conf=s' => \$conf,
'
nobackup
'
=>
\
$no_backup
,
'
full_stats
'
=>
\
$full_stats
,
'
descriptions
'
=>
\
$descriptions
,
'
release=i
'
=>
\
$release
,
'
no_database
'
=>
\
$no_database
,
'
help
'
=>
sub
{
usage
();
exit
(
0
);
});
if
(
!
$conf
||
!
$compara
||
!
$from_species
||
!
@to_multi
)
{
if
(
!
$conf
)
{
print
STDERR
"
Configuration file must be supplied via -conf argument
\n
";
usage
();
exit
(
1
);
}
elsif
(
!
$compara
)
{
print
STDERR
"
Compara database must be supplied via -compara argument
\n
";
usage
();
exit
(
1
);
}
elsif
(
!
$from_species
)
{
print
STDERR
"
From species must be supplied via -from argument
\n
";
usage
();
exit
(
1
);
}
elsif
(
!
@to_multi
)
{
print
STDERR
"
At least one target species must be supplied via the -to argument
\n
";
usage
();
exit
(
1
);
}
elsif
(
!
$release
&&
!
$no_database
)
{
print
STDERR
"
Release must be specified via -release argument unless -no_database is used
\n
";
usage
();
exit
(
1
);
...
...
@@ -38,8 +65,8 @@ if (!$conf|| !$compara || !$from_species || !@to_multi) {
if
(
!
$go_terms
&&
!
$names
)
{
print
"
One or both of --names or --go_terms must be specified
\n
";
print
"
Use --help for more detailed usage informaion
\n
";
print
STDERR
"
One or both of --names or --go_terms must be specified
\n
";
print
STDERR
"
Use --help for more detailed usage informaion
\n
";
exit
(
1
);
}
...
...
@@ -67,6 +94,8 @@ foreach my $to_species (@to_multi) {
my
$to_ga
=
Bio::EnsEMBL::
Registry
->
get_adaptor
(
$to_species
,
'
core
',
'
Gene
');
my
$to_dbea
=
Bio::EnsEMBL::
Registry
->
get_adaptor
(
$to_species
,
'
core
',
'
DBEntry
');
write_to_projection_db
(
$to_ga
->
dbc
(),
$release
,
$from_species
,
$from_ga
->
dbc
(),
$to_species
)
unless
(
$no_database
);
backup
(
$to_ga
)
if
(
!
$no_backup
);
delete_names
(
$to_ga
)
if
(
$delete_names
);
...
...
@@ -365,7 +394,7 @@ sub count_rows {
$sth
->
execute
();
return
(
$sth
->
fetchrow_array
())[
0
];
}
# ----------------------------------------------------------------------
...
...
@@ -480,6 +509,38 @@ sub backup {
# ----------------------------------------------------------------------
sub
write_to_projection_db
{
my
(
$to_dbc
,
$release
,
$from_species
,
$from_dbc
,
$to_species
)
=
@_
;
my
$host
=
$to_dbc
->
host
();
my
$port
=
$to_dbc
->
port
();
my
$user
=
$to_dbc
->
username
();
my
$pass
=
$to_dbc
->
password
();
my
$dbname
=
"
projection_info
";
my
$from_dbname
=
$from_dbc
->
dbname
();
my
$to_dbname
=
$to_dbc
->
dbname
();
my
$db
=
DBI
->
connect
("
dbi:mysql:host=
$host
;port=
$port
;database=
$dbname
",
"
$user
",
"
$pass
",
{'
RaiseError
'
=>
1
})
||
die
"
Can't connect to
"
.
$dbname
;
my
$sth
=
$db
->
prepare
("
INSERT INTO projections (release, timestamp, from_db, from_species_latin, from_species_common, to_db, to_species_latin, to_species_common) VALUES (?, NOW(), ?, ?, ?, ?, ?, ?)
");
$sth
->
execute
(
$release
,
$from_dbname
,
ucfirst
(
Bio::EnsEMBL::
Registry
->
get_alias
(
$from_species
)),
$from_species
,
$to_dbname
,
ucfirst
(
Bio::EnsEMBL::
Registry
->
get_alias
(
$to_species
)),
$to_species
)
||
die
"
Can't write to projection info database
\n
";
$sth
->
finish
();
}
# ----------------------------------------------------------------------
sub
usage
{
print
<<
"
EOF
";
...
...
@@ -508,6 +569,9 @@ sub usage {
several
--
to
arguments
or
a
comma
-
separated
list
,
e
.
g
.
-
from
human
-
to
dog
-
to
opossum
or
--
to
dog
,
opossum
--
release
The
current
Ensembl
release
.
Needed
for
projection_info
database
.
[
--
names
]
Project
display
names
and
descriptions
.
[
--
go_terms
]
Project
GO
terms
.
...
...
@@ -528,6 +592,8 @@ sub usage {
[--full_stats] Print full statistics, e.g. number of terms per evidence type
[--no_database] Don
'
t
write
to
the
projection_info
database
.
[
--
help
]
This
text
.
e
.
g
...
...
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