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

bugfix: added checking dataflow targets for fetchability

parent c3b85902
No related branches found
No related tags found
No related merge requests found
...@@ -186,12 +186,20 @@ sub build { ...@@ -186,12 +186,20 @@ sub build {
if(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis')) { if(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis')) {
$target_object->{'_inflow_count'}++; $target_object->{'_inflow_count'}++;
} }
} elsif( $df_rule->to_analysis->isa('Bio::EnsEMBL::Hive::Analysis') ) { # dataflow target is a foreign Analysis } else {
$target_object = $df_rule->to_analysis(); $target_object = $df_rule->to_analysis
$target_object->{'_foreign'}=1; or die "Could not fetch a target object for url='".$df_rule->to_analysis_url."', please check your database for consistency.\n";
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 ); if( UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis') ) { # dataflow target is a foreign Analysis
Bio::EnsEMBL::Hive::AnalysisStats->collection()->add( $foreign_stats ); # add it to the collection $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 ) { if( my $funnel_dataflow_rule = $df_rule->funnel_dataflow_rule ) {
...@@ -282,7 +290,9 @@ sub _propagate_allocation { ...@@ -282,7 +290,9 @@ sub _propagate_allocation {
my ($self, $source_analysis ) = @_; 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 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; my $target_node_name;
if(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis')) { if(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Analysis')) {
...@@ -292,7 +302,7 @@ sub _propagate_allocation { ...@@ -292,7 +302,7 @@ sub _propagate_allocation {
} elsif(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Accumulator')) { } elsif(UNIVERSAL::isa($target_object, 'Bio::EnsEMBL::Hive::Accumulator')) {
next; next;
} else { } 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; next;
} }
...@@ -454,8 +464,12 @@ sub _add_dataflow_rules { ...@@ -454,8 +464,12 @@ sub _add_dataflow_rules {
foreach my $df_rule ( @$dataflow_rules ) { foreach my $df_rule ( @$dataflow_rules ) {
my ($from_analysis, $branch_code, $funnel_dataflow_rule, $target_object) = my ($from_analysis, $branch_code, $funnel_dataflow_rule) =
($df_rule->from_analysis, $df_rule->branch_code, $df_rule->funnel_dataflow_rule, $df_rule->to_analysis); ($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 $from_node_name = $self->_analysis_node_name( $from_analysis );
my $target_node_name; my $target_node_name;
...@@ -474,7 +488,7 @@ sub _add_dataflow_rules { ...@@ -474,7 +488,7 @@ sub _add_dataflow_rules {
$target_node_name = _midpoint_name( $from_analysis->{'_funnel_dfr'} ); $target_node_name = _midpoint_name( $from_analysis->{'_funnel_dfr'} );
} else { } 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; 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