Commit 66750d45 authored by Leo Gordon's avatar Leo Gordon
Browse files

AnalysisJob.prev_job_id/prev_job are autoloaded ; started using prev_job()

parent 58a243be
......@@ -49,17 +49,13 @@ use base ( 'Bio::EnsEMBL::Hive::Storable', # inherit dbID(), adaptor() and new(
=head1 AUTOLOADED
prev_job_id / prev_job
analysis_id / analysis
=cut
sub prev_job_id {
my $self = shift;
$self->{'_prev_job_id'} = shift if(@_);
return $self->{'_prev_job_id'};
}
sub input_id {
my $self = shift;
if(@_) {
......@@ -325,7 +321,7 @@ sub dataflow_output_id {
my $fan_cache_this_branch = $self->fan_cache()->{$funnel_dataflow_rule_id} ||= [];
push @$fan_cache_this_branch, map { Bio::EnsEMBL::Hive::AnalysisJob->new(
'prev_job_id' => $self->dbID,
'prev_job' => $self,
'analysis' => $target_analysis_or_table, # expecting an Analysis
'input_id' => $_,
'param_id_stack' => $param_id_stack,
......@@ -346,7 +342,7 @@ sub dataflow_output_id {
} else {
my $funnel_job = Bio::EnsEMBL::Hive::AnalysisJob->new(
'prev_job_id' => $self->dbID,
'prev_job' => $self,
'analysis' => $target_analysis_or_table, # expecting an Analysis
'input_id' => $output_ids_for_this_rule->[0],
'param_id_stack' => $param_id_stack,
......@@ -366,7 +362,7 @@ sub dataflow_output_id {
}
} else { # non-semaphored dataflow (but potentially propagating any existing semaphores)
my @non_semaphored_jobs = map { Bio::EnsEMBL::Hive::AnalysisJob->new(
'prev_job_id' => $self->dbID,
'prev_job' => $self,
'analysis' => $target_analysis_or_table, # expecting an Analysis
'input_id' => $_,
'param_id_stack' => $param_id_stack,
......
......@@ -602,7 +602,7 @@ sub run {
# now create the corresponding jobs (if there are any):
if($input_ids) {
my @jobs = map { Bio::EnsEMBL::Hive::AnalysisJob->new(
'prev_job_id' => undef, # these jobs are created by the initialization script, not by another job
'prev_job' => undef, # these jobs are created by the initialization script, not by another job
'analysis' => $analysis,
'input_id' => $_, # input_ids are now centrally stringified in the AnalysisJob itself
) } @$input_ids;
......
......@@ -91,7 +91,7 @@ sub main {
}
my $job = Bio::EnsEMBL::Hive::AnalysisJob->new(
'prev_job_id' => undef, # this job has been created by the initialization script, not by another job
'prev_job' => undef, # this job has been created by the initialization script, not by another job
'analysis' => $analysis,
'input_id' => destringify( $input_id ), # Make sure all job creations undergo re-stringification to avoid alternative "spellings" of the same input_id hash
);
......
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