Skip to content
Snippets Groups Projects
Commit 413d2a1a authored by Leo Gordon's avatar Leo Gordon
Browse files

pulled in from version/2.1 : bugfix: added checking dataflow targets for fetchability

parents c7d37a45 6c7d78de
No related branches found
No related tags found
No related merge requests found
......@@ -186,12 +186,20 @@ sub build {
if(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis')) {
$target_object->{'_inflow_count'}++;
}
} elsif( $df_rule->to_analysis->isa('Bio::EnsEMBL::Hive::Analysis') ) { # dataflow target is a foreign Analysis
$target_object = $df_rule->to_analysis();
$target_object->{'_foreign'}=1;
Bio::EnsEMBL::Hive::Analysis->collection()->add( $target_object ); # add it to the collection
my $foreign_stats = $target_object->stats or die "Could not fetch foreign stats for ".$target_object->display_name( $self->hive_dba );
Bio::EnsEMBL::Hive::AnalysisStats->collection()->add( $foreign_stats ); # add it to the collection
} else {
$target_object = $df_rule->to_analysis
or die "Could not fetch a target object for url='".$df_rule->to_analysis_url."', please check your database for consistency.\n";
if( UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis') ) { # dataflow target is a foreign Analysis
$target_object->{'_foreign'}=1;
Bio::EnsEMBL::Hive::Analysis->collection()->add( $target_object ); # add it to the collection
my $foreign_stats = $target_object->stats or die "Could not fetch foreign stats for ".$target_object->display_name( $self->hive_dba );
Bio::EnsEMBL::Hive::AnalysisStats->collection()->add( $foreign_stats ); # add it to the collection
} elsif( UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::NakedTable') ) {
} elsif( UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Accumulator') ) {
} else {
warn "Do not know how to handle the type '".ref($target_object)."'";
}
}
if( my $funnel_dataflow_rule = $df_rule->funnel_dataflow_rule ) {
......@@ -282,7 +290,9 @@ sub _propagate_allocation {
my ($self, $source_analysis ) = @_;
foreach my $df_rule ( @{ $source_analysis->dataflow_rules_collection } ) { # this will only work if the analyses objects are ALL cached before loading DFRs
my $target_object = $df_rule->to_analysis();
my $target_object = $df_rule->to_analysis
or die "Could not fetch a target object for url='".$df_rule->to_analysis_url."', please check your database for consistency.\n";
my $target_node_name;
if(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis')) {
......@@ -292,7 +302,7 @@ sub _propagate_allocation {
} elsif(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Accumulator')) {
next;
} else {
warn('Do not know how to handle the type '.ref($target_object));
warn("Do not know how to handle the type '".ref($target_object)."'");
next;
}
......@@ -454,8 +464,12 @@ sub _add_dataflow_rules {
foreach my $df_rule ( @$dataflow_rules ) {
my ($from_analysis, $branch_code, $funnel_dataflow_rule, $target_object) =
($df_rule->from_analysis, $df_rule->branch_code, $df_rule->funnel_dataflow_rule, $df_rule->to_analysis);
my ($from_analysis, $branch_code, $funnel_dataflow_rule) =
($df_rule->from_analysis, $df_rule->branch_code, $df_rule->funnel_dataflow_rule);
my $target_object = $df_rule->to_analysis
or die "Could not fetch a target object for url='".$df_rule->to_analysis_url."', please check your database for consistency.\n";
my $from_node_name = $self->_analysis_node_name( $from_analysis );
my $target_node_name;
......@@ -474,7 +488,7 @@ sub _add_dataflow_rules {
$target_node_name = _midpoint_name( $from_analysis->{'_funnel_dfr'} );
} else {
warn('Do not know how to handle the type '.ref($target_object));
warn("Do not know how to handle the type '".ref($target_object)."'");
next;
}
......
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