Commit 568cfa08 authored by Leo Gordon's avatar Leo Gordon
Browse files

introduced new method HivePipeline::get_source_analyses and used it in Utils::Graph

parent c6286485
......@@ -210,6 +210,19 @@ sub add_new_or_update {
}
=head2 get_source_analyses
Description: returns a listref of analyses that do not have local inflow ("source analyses")
=cut
sub get_source_analyses {
my $self = shift @_;
return [ grep { ! $_->inflow_rules_count } $self->collection_of( 'Analysis' )->list ];
}
=head2 get_meta_value_by_key
Description: returns a particular meta_value from 'MetaParameters' collection given meta_key
......
......@@ -167,13 +167,12 @@ sub build {
my $pipeline = $self->pipeline;
# NB: this is a very approximate algorithm with rough edges!
# It will not find all start nodes in cyclic components!
foreach my $source_analysis ( $pipeline->collection_of('Analysis')->list ) {
if( !$source_analysis->inflow_rules_count and $source_analysis->is_local_to($pipeline) ) { # if there is no dataflow into this analysis
# run the recursion in each component that has a non-cyclic start:
$self->_propagate_allocation( $source_analysis );
}
# FIXME: using this approach we will never reach cyclic components that lack zero-inflow source nodes!
# But we have to start somewhere...
#
foreach my $source_analysis ( @{ $pipeline->get_source_analyses } ) {
# run the recursion in each component that has a non-cyclic start:
$self->_propagate_allocation( $source_analysis );
}
if( $self->config_get('DisplayDetails') ) {
......
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