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
c981eeba
Commit
c981eeba
authored
17 years ago
by
Patrick Meidl
Browse files
Options
Downloads
Patches
Plain Diff
now can run as an lsf job array
parent
80e8066d
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/id_mapping/dump_by_seq_region.pl
+25
-15
25 additions, 15 deletions
misc-scripts/id_mapping/dump_by_seq_region.pl
with
25 additions
and
15 deletions
misc-scripts/id_mapping/dump_by_seq_region.pl
+
25
−
15
View file @
c981eeba
...
...
@@ -56,6 +56,7 @@ use FindBin qw($Bin);
use
Bio::EnsEMBL::Utils::
ConfParser
;
use
Bio::EnsEMBL::Utils::
Logger
;
use
Bio::EnsEMBL::Utils::
ScriptUtils
qw(dynamic_use path_append)
;
use
Bio::EnsEMBL::Utils::
Exception
qw(throw warning)
;
# parse configuration and commandline arguments
my
$conf
=
new
Bio::EnsEMBL::Utils::
ConfParser
(
...
...
@@ -77,8 +78,8 @@ $conf->parse_options(
'
basedir|basedir=s
'
=>
1
,
'
biotypes=s@
'
=>
0
,
'
dbtype=s
'
=>
1
,
'
slice_name=s
'
=>
1
,
'
cache_impl=s
'
=>
1
,
'
index|i=n
'
=>
1
,
);
# set default logpath
...
...
@@ -89,21 +90,26 @@ unless ($conf->param('logpath')) {
$conf
->
param
('
logpath
',
path_append
(
$conf
->
param
('
logpath
'),
'
dump_by_seq_region
'));
# append job index to logfile name
my
$dbtype
=
$conf
->
param
('
dbtype
');
my
$index
=
$conf
->
param
('
index
');
my
$logautobase
=
(
$conf
->
param
('
logautobase
')
||
'
dump_by_seq_region
')
.
"
.
$dbtype
";
# get log filehandle and print heading and parameters to logfile
my
$logger
=
new
Bio::EnsEMBL::Utils::
Logger
(
-
LOGFILE
=>
$conf
->
param
('
logfile
'),
-
LOGAUTO
=>
$conf
->
param
('
logauto
'),
-
LOGAUTOBASE
=>
$
conf
->
param
('
logautobase
')
||
'
dump_by_seq_region
'
,
-
LOGAUTOBASE
=>
$
logautobase
,
-
LOGAUTOID
=>
$conf
->
param
('
logautoid
'),
-
LOGPATH
=>
$conf
->
param
('
logpath
'),
-
LOGAPPEND
=>
$conf
->
param
('
logappend
')
,
-
LOGAPPEND
=>
1
,
-
LOGLEVEL
=>
$conf
->
param
('
loglevel
'),
-
IS_COMPONENT
=>
1
,
);
# build cache
my
$cache_impl
=
$conf
->
param
('
cache_impl
');
dynamic_use
(
$cache_impl
);
my
$cache
=
$cache_impl
->
new
(
...
...
@@ -111,18 +117,22 @@ my $cache = $cache_impl->new(
-
CONF
=>
$conf
,
);
my
$dbtype
=
$conf
->
param
('
dbtype
');
my
$slice_name
=
$conf
->
param
('
slice_name
');
my
$i
=
0
;
my
$size
=
0
;
(
$i
,
$size
)
=
$cache
->
build_cache
(
$dbtype
,
$slice_name
);
# determine which slice to process. to do so, read the file containing the
# slices to be processed, and take the one at position $index
my
$logpath
=
$conf
->
param
('
logpath
');
my
$filename
=
"
$dbtype
.dump_cache.slices.txt
";
open
(
my
$fh
,
'
<
',
"
$logpath
/
$filename
")
or
throw
("
Unable to open
$logpath
/
$filename
for reading: $!
");
my
@slice_names
=
<
$fh
>
;
my
$slice_name
=
$slice_names
[
$index
-
1
];
chomp
(
$slice_name
);
close
(
$fh
);
# no build the cache for this slice
$cache
->
build_cache_by_slice
(
$dbtype
,
$slice_name
);
# set flag to indicate everything went fine
my
$success_file
=
$conf
->
param
('
logpath
')
.
"
/
dump_by_seq_region.
$dbtype
.
$slice_name
.success
";
my
$success_file
=
$conf
->
param
('
logpath
')
.
"
/
$logautobase
.
$index
.success
";
open
(
TMPFILE
,
'
>
',
$success_file
)
and
close
TMPFILE
or
die
"
Can't open
$success_file
for writing: $!
";
# log success
$logger
->
info
("
Done with
$dbtype
$slice_name
(genes:
$i
, filesize:
$size
, runtime:
"
.
$logger
->
runtime
.
"
"
.
$logger
->
date_and_mem
.
"
\n
");
or
throw
"
Can't open
$success_file
for writing: $!
";
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