Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
2b994c7b
Commit
2b994c7b
authored
May 26, 2011
by
Leo Gordon
Browse files
new script for running standalone jobs
parent
bccf3990
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
0 deletions
+102
-0
scripts/standaloneJob.pl
scripts/standaloneJob.pl
+102
-0
No files found.
scripts/standaloneJob.pl
0 → 100755
View file @
2b994c7b
#!/usr/bin/env perl
use
strict
;
use
warnings
;
use
Getopt::
Long
qw(:config pass_through)
;
use
Bio::EnsEMBL::
Registry
;
use
Bio::EnsEMBL::Hive::
Process
;
use
Bio::EnsEMBL::Hive::
AnalysisJob
;
use
Bio::EnsEMBL::Hive::
Utils
('
script_usage
',
'
load_file_or_module
',
'
parse_cmdline_options
',
'
stringify
');
my
(
$reg_conf
,
$help
,
$debug
,
$no_write
);
my
$module_or_file
=
shift
@ARGV
or
script_usage
();
GetOptions
(
'
help
'
=>
\
$help
,
'
debug=i
'
=>
\
$debug
,
'
reg_conf|regfile=s
'
=>
\
$reg_conf
,
'
no_write|nowrite
'
=>
\
$no_write
,
);
if
(
$help
or
!
$module_or_file
)
{
script_usage
(
0
);
}
my
$runnable_module
=
load_file_or_module
(
$module_or_file
);
if
(
$reg_conf
)
{
Bio::EnsEMBL::
Registry
->
load_all
(
$reg_conf
);
}
my
$process
=
$runnable_module
->
new
();
my
$job
=
Bio::EnsEMBL::Hive::
AnalysisJob
->
new
();
my
(
$param_hash
,
$param_list
)
=
parse_cmdline_options
();
$job
->
param_init
(
1
,
$process
->
param_defaults
(),
$param_hash
);
my
$input_id
=
stringify
(
$param_hash
);
$job
->
input_id
(
$input_id
);
warn
"
\n
Running '
$runnable_module
' with '
$input_id
' :
\n
";
$process
->
input_job
(
$job
);
if
(
$debug
)
{
$process
->
debug
(
$debug
);
}
# job's life cycle:
warn
"
\n
FETCH_INPUT:
\n
";
$process
->
fetch_input
();
warn
"
\n
RUN:
\n
";
$process
->
run
();
unless
(
$no_write
)
{
warn
"
\n
WRITE_OUTPUT:
\n
";
$process
->
write_output
();
}
warn
"
\n
DONE.
\n
";
exit
(
0
);
__DATA__
=pod
=head1 NAME
standaloneJob.pl
=head1 DESCRIPTION
standaloneJob.pl is an eHive component script that
1. takes in a RunnableDB module,
2. creates a standalone job outside an eHive database by initializing parameters from command line arguments
3. and runs that job outside the database.
Naturally, only certain RunnableDB modules can be run using this script, and some database-related functionality will be lost.
=head1 USAGE EXAMPLES
# Just run a job with default parameters:
standaloneJob.pl Bio::EnsEMBL::Hive::RunnableDB::FailureTest
# Run a job and re-define some of the default parameters:
standaloneJob.pl Bio::EnsEMBL::Hive::RunnableDB::FailureTest -time_RUN=2 -time_WRITE_OUTPUT=3 -state=WRITE_OUTPUT -value=2
standaloneJob.pl Bio::EnsEMBL::Hive::RunnableDB::SystemCmd -cmd 'ls -l'
# Run a job with given parameters, but skip the write_output() step:
standaloneJob.pl Bio::EnsEMBL::Hive::RunnableDB::FailureTest -no_write -time_RUN=2 -time_WRITE_OUTPUT=3 -state=WRITE_OUTPUT -value=2
=head1 SCRIPT-SPECIFIC OPTIONS
-help : print this help
-debug <level> : turn on debug messages at <level>
-no_write : skip the execution of write_output() step this time
NB: all other options will be passed to the runnable (leading dashes removed) and will constitute the parameters for the job.
=head1 CONTACT
Please contact ehive-users@ebi.ac.uk mailing list with questions/suggestions.
=cut
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment