9 Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
10 Copyright [2016-2024] EMBL-European Bioinformatics Institute
12 Licensed under the Apache License,
Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
13 You may obtain a copy of the License at
17 Unless required by applicable law or agreed to in writing, software distributed under the License
18 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License
for the specific language governing permissions and limitations under the License.
23 Please subscribe to the
Hive mailing list: http:
28 package Bio::EnsEMBL::Hive::DataflowTarget;
36 use base (
'Bio::EnsEMBL::Hive::Storable' );
39 sub unikey { #
override the
default from
Cacheable parent
40 return [
'source_dataflow_rule',
'on_condition',
'input_id_template',
'to_analysis_url' ];
46 source_dataflow_rule_id / source_dataflow_rule
53 Function: getter/setter method
for the on_condition of the dataflow target
61 $self->{
'_on_condition'} = shift @_;
63 return $self->{
'_on_condition'};
67 =head2 input_id_template
69 Function: getter/setter method
for the input_id_template of the dataflow target
73 sub input_id_template {
77 my $input_id_template = shift @_;
78 $self->{
'_input_id_template'} = (ref($input_id_template) ? stringify($input_id_template) : $input_id_template),
80 return $self->{
'_input_id_template'};
84 =head2 extend_param_stack
86 Function: getter/setter method. The
boolean value defines whether the newly created jobs will inherit both the parameters and the accu of the prev_job.
90 sub extend_param_stack {
94 $self->{
'_extend_param_stack'} = shift @_;
96 return $self->{
'_extend_param_stack'};
100 =head2 to_analysis_url
102 Arg[1] : (optional)
string $url
103 Usage : $self->to_analysis_url($url);
104 Function: Get/set method
for the
'to' analysis objects URL
for this rule
109 sub to_analysis_url {
113 $self->{
'_to_analysis_url'} = shift @_;
114 if( $self->{
'_to_analysis'} ) {
115 $self->{
'_to_analysis'} = undef;
117 } elsif( !$self->{
'_to_analysis_url'} and my $target_object=$self->{
'_to_analysis'} ) {
119 my $ref_pipeline = $self->from_analysis && $self->from_analysis->
hive_pipeline;
120 $self->{
'_to_analysis_url'} = $target_object->relative_url( $ref_pipeline ); # the URL may be shorter
if hive_pipeline is the same
for source and target
123 return $self->{
'_to_analysis_url'};
129 Usage : $self->to_analysis($analysis);
130 Function: Get/set method
for the goal analysis
object of
this rule.
137 my ($self, $target_object) = @_;
139 if( defined $target_object ) {
140 unless ($target_object->can(
'url')) {
141 throw(
"to_analysis arg must support 'url' method, '$target_object' does not know how to do it");
143 $self->{
'_to_analysis'} = $target_object;
146 if( !$self->{
'_to_analysis'} and my $to_analysis_url = $self->to_analysis_url ) { # lazy-load through TheApiary
151 return $self->{
'_to_analysis'};
158 Example : print $df_rule->toString().
"\n";
159 Description: returns a stringified representation of the rule
166 my $short = shift @_;
168 my $on_condition = $self->on_condition;
171 $short ? () : (
'DataflowTarget: ' ),
172 defined($on_condition) ?
'WHEN '.$on_condition :
'DEFAULT ',
174 $self->to_analysis_url,
175 ($self->input_id_template ? (
' WITH TEMPLATE: '.$self->input_id_template) :
''),