Bio::EnsEMBL::Hive
AnalysisCtrlRule
Toolbar
Summary
Bio::EnsEMBL::Hive::AnalysisCtrlRule
Package variables
No package variables defined.
Included modules
Synopsis
Description
An 'analysis control rule' is a high level blocking control structure where there is
a 'ctrled_analysis' which is 'BLOCKED' from running until all of its 'condition_analysis' are 'DONE'.
If a ctrled_analysis requires multiple analysis to be DONE before it can run, a separate
AnalysisCtrlRule must be created/stored for each condtion analysis.
Allows the 'condition' analysis to be specified with a network savy URL like
mysql://ensadmin:<pass>@ecs2:3361/compara_hive_test?analysis.logic_name='blast_NCBI34'
Methods
Methods description
Arg[1] : (optional) Bio::EnsEMBL::Analysis object Usage : $self->condition_analysis($anal); Function: Get/set method for the analysis which must be 'DONE' in order for the controlled analysis to be un-BLOCKED Returns : Bio::EnsEMBL::Analysis |
Arg[1] : (optional) string $url Usage : $self->condition_analysis_url($url); Function: Get/set method for the analysis which must be 'DONE' in order for the controlled analysis to be un-BLOCKED. Specified as a URL. Returns : string |
Arg[1] : (optional) Bio::EnsEMBL::Analysis object Usage : $self->ctrled_analysis($anal); Function: Get/set method for the analysis which will be BLOCKED until all of its condition analyses are 'DONE' Returns : Bio::EnsEMBL::Analysis |
Arg[1] : (optional) int $dbID Usage : $self->ctrled_analysis_id($dbID); Function: Get/set method for the analysis which will be BLOCKED until all of its condition analyses are 'DONE'. Specified as a dbID. Returns : integer |
Usage : $ctrlRule->print_rule; Function: Prints a description of the rule for use in debugging. |
Methods code
sub adaptor
{ my ( $self, $adaptor ) = @_;
$self->{'_adaptor'} = $adaptor if defined $adaptor;
return $self->{'_adaptor'}; } |
sub condition_analysis
{ my ($self,$analysis) = @_;
if( defined $analysis ) {
unless ($analysis->isa('Bio::EnsEMBL::Analysis')) {
throw(
"condition_analysis arg must be a [Bio::EnsEMBL::Analysis]".
"not a [$analysis]");
}
$self->{'_condition_analysis'} = $analysis;
if($self->ctrled_analysis and ($self->ctrled_analysis->adaptor == $analysis->adaptor)) {
$self->{'_condition_analysis_url'} = $analysis->logic_name;
} else {
$self->{'_condition_analysis_url'} = $analysis->url;
}
}
if(!defined($self->{'_condition_analysis'}) and defined($self->condition_analysis_url)) {
$analysis = Bio::EnsEMBL::Hive::URLFactory->fetch($self->condition_analysis_url);
unless($analysis) {
$analysis =
$self->adaptor->db->get_AnalysisAdaptor->fetch_by_logic_name($self->condition_analysis_url);
}
$self->{'_condition_analysis'} = $analysis;
}
return $self->{'_condition_analysis'}; } |
sub condition_analysis_url
{ my ($self,$url) = @_;
if($url) {
$self->{'_condition_analysis_url'} = $url;
$self->{'_condition_analysis'} = undef;
}
return $self->{'_condition_analysis_url'}; } |
sub ctrled_analysis
{ my ($self,$analysis) = @_;
if( defined $analysis ) {
unless ($analysis->isa('Bio::EnsEMBL::Analysis')) {
throw(
"ctrled_analysis arg must be a [Bio::EnsEMBL::Analysis]".
"not a [$analysis]");
}
$self->{'_ctrled_analysis'} = $analysis;
$self->{'_ctrled_analysis_id'} = $analysis->dbID;
}
if(!defined($self->{'_ctrled_analysis'})
and defined($self->ctrled_analysis_id)
and defined($self->adaptor))
{
$self->{'_ctrled_analysis'} =
$self->adaptor->db->get_AnalysisAdaptor->fetch_by_dbID($self->ctrled_analysis_id);
}
return $self->{'_ctrled_analysis'}; } |
sub ctrled_analysis_id
{ my ($self,$analysis_id) = @_;
if($analysis_id) {
$self->{'_ctrled_analysis_id'} = $analysis_id;
$self->{'_ctrled_analysis'} = undef;
}
return $self->{'_ctrled_analysis_id'}; } |
sub new
{ my ($class,@args) = @_;
my $self = bless {}, $class;
return $self; } |
sub print_rule
{ my $self = shift;
print("AnalysisCtrlRule ",
" ctrled_analysis_id=", $self->ctrled_analysis_id,
" condition_analysis_url=", $self->condition_analysis_url,
"\n");
}
1; } |
General documentation
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _
Title : new
Usage : ...AnalysisCtrlRule->new;
Function: Constructor for empty AnalysisCtrlRule object
Returns : Bio::EnsEMBL::Hive::AnalysisCtrlRule
Args : none