Commit 449f14c0 authored by Jessica Severin's avatar Jessica Severin
Browse files

added -logic_name option so one can specify either a logic_name or

analysis_id to identify which analysis this worker is to use
parent 393aa06f
......@@ -19,6 +19,7 @@ $self->{'db_conf'}->{'-user'} = 'ensro';
$self->{'db_conf'}->{'-port'} = 3306;
$self->{'analysis_id'} = undef;
$self->{'logic_name'} = undef;
$self->{'outdir'} = undef;
$self->{'beekeeper'} = undef;
......@@ -34,6 +35,7 @@ GetOptions('help' => \$help,
'dbpass=s' => \$pass,
'dbname=s' => \$dbname,
'analysis_id=i' => \$self->{'analysis_id'},
'logic_name=s' => \$self->{'logic_name'},
'batchsize=i' => \$self->{'batch_size'},
'limit=i' => \$self->{'job_limit'},
'lifespan=i' => \$self->{'lifespan'},
......@@ -74,9 +76,13 @@ if($url) {
$DBA = new Bio::EnsEMBL::Hive::DBSQL::DBAdaptor(%{$self->{'db_conf'}});
}
my $queen = $DBA->get_Queen();
if($self->{'logic_name'}) {
my $analysis = $queen->db->get_AnalysisAdaptor->fetch_by_logic_name($self->{'logic_name'});
$self->{'analysis_id'} = $analysis->dbID if($analysis);
}
my $worker = $queen->create_new_worker($self->{'analysis_id'}, $self->{'beekeeper'});
die("couldn't create worker for analysis_id ".$self->{'analysis_id'}."\n") unless($worker);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment