9 A data container object (methods are intelligent getters/setters) that corresponds to a row stored in
'dataflow_rule' table
12 The current RunnableDB's analysis ($from_analysis) and the requested $branch_code (1 by
default) define the entry conditions,
13 and whatever rules match these conditions will generate
new jobs with input_ids specified in the dataflow_output_id() call.
14 If input_id_template happens to contain a non-NULL value, it will be used to generate the corresponding intput_id instead.
16 Jessica's remark on the structure of to_analysis_url:
17 Extended from design of SimpleRule concept to allow the 'to' analysis to be specified with a network savy URL like
22 Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
23 Copyright [2016-2022] EMBL-European Bioinformatics Institute
25 Licensed under the Apache License,
Version 2.0 (the "License"); you may not use this file except in compliance with the License.
26 You may obtain a copy of the License at
30 Unless required by applicable law or agreed to in writing, software distributed under the License
31 is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32 See the License for the specific language governing permissions and limitations under the License.
36 Please subscribe to the
Hive mailing list: http:
47 use
Bio::EnsEMBL::
Hive::DBSQL::DataflowRuleAdaptor;
53 return [
'from_analysis',
'branch_code',
'funnel_dataflow_rule',
'unitargets' ];
59 from_analysis_id / from_analysis
61 funnel_dataflow_rule_id / funnel_dataflow_rule
68 Function: getter/setter method
for the branch_code of the dataflow rule
76 my $branch_name_or_code = shift @_;
79 return $self->{
'_branch_code'};
86 return $self->hive_pipeline->collection_of(
'DataflowTarget' )->find_all_by(
'source_dataflow_rule', $self);
90 sub get_my_targets_grouped_by_condition {
92 my $df_targets = shift @_;
96 my %my_targets_by_condition = ();
97 foreach my $df_target (@$df_targets) {
98 my $this_pair = $my_targets_by_condition{ $df_target->on_condition
99 push @{$this_pair->[1]}, $df_target;
102 return [ sort { ($b->[0]
106 sub _compute_unitargets {
108 return join(
';', map { ($_->on_condition
109 sort { ($a->on_condition
110 or ($a->input_id_template
114 # NOTE: By caching the "unitargets" value, we assume that the list of 115 # targets will *not* change once the object is loaded. This holds true at 116 # the moment, but we need to be careful it remains the case in the future, 117 # otherwise the bits that change the targets would have to invalidate the 123 $self->{
'_cached_unitargets'} = shift @_;
126 unless ($self->{
'_cached_unitargets'}) {
127 my $targets = $self->get_my_targets;
128 $self->{
'_cached_unitargets'} = _compute_unitargets( $targets );
131 return $self->{
'_cached_unitargets'};
138 Example : print $df_rule->toString().
"\n";
139 Description: returns a stringified representation of the rule
146 my $short = shift @_;
153 $self->from_analysis->logic_name,
158 join(
', ', map { $_->toString($short) } sort { ($b->on_condition
160 ($self->funnel_dataflow_rule ?
' ---|| ('.$self->funnel_dataflow_rule->toString(1).
' )' :
''),
public dataflow_output_id()
public branch_name_2_code()