Commit c81b5371 authored by Jessica Severin's avatar Jessica Severin
Browse files

removed references to Bio::EnsEMBL::Root and it's inherited methods

created new() methods where needed, replaced throw, rearrange as needed
parent e28dfd1e
......@@ -40,13 +40,11 @@
package Bio::EnsEMBL::Hive::AnalysisCtrlRule;
use vars qw(@ISA);
use Bio::EnsEMBL::Root;
use strict;
use Bio::EnsEMBL::Hive::URLFactory;
use Bio::EnsEMBL::Hive::Extensions;
use strict;
@ISA = qw( Bio::EnsEMBL::Root );
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
=head2 Constructor
......@@ -59,8 +57,8 @@ use strict;
sub new {
my ($class,@args) = @_;
my $self = $class->SUPER::new(@args);
my $self = bless {}, $class;
return $self;
}
......@@ -118,7 +116,7 @@ sub ctrled_analysis {
# setter mode
if( defined $analysis ) {
unless ($analysis->isa('Bio::EnsEMBL::Analysis')) {
$self->throw(
throw(
"ctrled_analysis arg must be a [Bio::EnsEMBL::Analysis]".
"not a [$analysis]");
}
......@@ -150,7 +148,7 @@ sub condition_analysis {
if( defined $analysis ) {
unless ($analysis->isa('Bio::EnsEMBL::Analysis')) {
$self->throw(
throw(
"condition_analysis arg must be a [Bio::EnsEMBL::Analysis]".
"not a [$analysis]");
}
......
......@@ -31,15 +31,15 @@ package Bio::EnsEMBL::Hive::AnalysisJob;
use strict;
use Bio::EnsEMBL::Root;
use Bio::EnsEMBL::Analysis;
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Hive::Worker;
use vars qw(@ISA);
@ISA = qw(Bio::EnsEMBL::Root);
sub new {
my ($class,@args) = @_;
my $self = bless {}, $class;
return $self;
}
sub adaptor {
my $self = shift;
......
......@@ -25,15 +25,15 @@ package Bio::EnsEMBL::Hive::AnalysisStats;
use strict;
use Bio::EnsEMBL::Root;
use Bio::EnsEMBL::Analysis;
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Hive::Worker;
use vars qw(@ISA);
@ISA = qw(Bio::EnsEMBL::Root);
sub new {
my ($class,@args) = @_;
my $self = bless {}, $class;
return $self;
}
sub adaptor {
my $self = shift;
......
......@@ -40,6 +40,8 @@ use strict;
use Carp;
use Bio::EnsEMBL::DBSQL::BaseAdaptor;
use Bio::EnsEMBL::Hive::AnalysisCtrlRule;
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
our @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
......@@ -58,7 +60,7 @@ sub fetch_by_ctrled_analysis_id{
my ($self,$id) = @_;
unless(defined $id) {
$self->throw("fetch_by_ctrled_analysis_id must have an id");
throw("fetch_by_ctrled_analysis_id must have an id");
}
my $constraint = "r.ctrled_analysis_id = $id";
......@@ -116,7 +118,7 @@ sub remove {
my $dbID = $rule->dbID;
if( !defined $dbID ) {
$self->throw( "AnalysisCtrlRuleAdaptor->remove called with non persistent AnalysisCtrlRule" );
throw( "AnalysisCtrlRuleAdaptor->remove called with non persistent AnalysisCtrlRule" );
}
my $sth = $self->prepare("DELETE FROM analysis_ctrl_rule WHERE ctrled_analysis_id = ?, condition_analysis_url = '?'");
......
......@@ -46,8 +46,8 @@ use Bio::EnsEMBL::DBSQL::BaseAdaptor;
use Sys::Hostname;
use Data::UUID;
use Bio::EnsEMBL::Utils::Argument qw(rearrange);
use Bio::EnsEMBL::Utils::Exception qw(throw warning);
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
our @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
......@@ -106,7 +106,7 @@ sub fetch_by_dbID {
my ($self,$id) = @_;
unless(defined $id) {
$self->throw("fetch_by_dbID must have an id");
throw("fetch_by_dbID must have an id");
}
my @tabs = $self->_tables;
......@@ -134,8 +134,8 @@ sub fetch_by_dbID {
sub fetch_by_claim_analysis {
my ($self,$claim,$analysis_id) = @_;
$self->throw("fetch_by_claim_analysis must have claim ID") unless($claim);
$self->throw("fetch_by_claim_analysis must have analysis_id") unless($analysis_id);
throw("fetch_by_claim_analysis must have claim ID") unless($claim);
throw("fetch_by_claim_analysis must have analysis_id") unless($analysis_id);
my $constraint = "a.job_claim='$claim' AND a.analysis_id='$analysis_id'";
return $self->_generic_fetch($constraint);
}
......
......@@ -38,6 +38,8 @@ package Bio::EnsEMBL::Hive::DBSQL::AnalysisStatsAdaptor;
use strict;
use Bio::EnsEMBL::Hive::AnalysisStats;
use Bio::EnsEMBL::DBSQL::BaseAdaptor;
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
our @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
......@@ -57,7 +59,7 @@ sub fetch_by_analysis_id {
my ($self,$id) = @_;
unless(defined $id) {
$self->throw("fetch_by_analysis_id must have an id");
throw("fetch_by_analysis_id must have an id");
}
my $constraint = "ast.analysis_id = $id";
......
......@@ -40,6 +40,8 @@ use strict;
use Carp;
use Bio::EnsEMBL::DBSQL::BaseAdaptor;
use Bio::EnsEMBL::Hive::DataflowRule;
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
our @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
......@@ -60,8 +62,8 @@ sub fetch_from_analysis_job
my $rule;
my @rules;
$self->throw("arg is required\n") unless($fromAnalysisJob);
$self->throw("arg must be a [Bio::EnsEMBL::Hive::AnalysisJob] not a $fromAnalysisJob")
throw("arg is required\n") unless($fromAnalysisJob);
throw("arg must be a [Bio::EnsEMBL::Hive::AnalysisJob] not a $fromAnalysisJob")
unless ($fromAnalysisJob->isa('Bio::EnsEMBL::Hive::AnalysisJob'));
my $constraint = "r.from_analysis_id = '".$fromAnalysisJob->analysis_id."'"
......@@ -123,7 +125,7 @@ sub remove {
my $dbID = $rule->dbID;
if( !defined $dbID ) {
$self->throw( "DataflowRuleAdaptor->remove called with non persistent DataflowRule" );
throw( "DataflowRuleAdaptor->remove called with non persistent DataflowRule" );
}
my $sth = $self->prepare("DELETE FROM dataflow_rule WHERE dataflow_rule_id = $dbID");
......@@ -223,7 +225,7 @@ sub fetch_by_dbID{
my ($self,$id) = @_;
unless(defined $id) {
$self->throw("fetch_by_dbID must have an id");
throw("fetch_by_dbID must have an id");
}
my @tabs = $self->_tables;
......
......@@ -66,11 +66,11 @@ sub fetch_by_condition_analysis
my $rule;
my @rules;
$self->throw("arg is required\n")
throw("arg is required\n")
unless($conditionAnalysis);
$self->throw("arg must be a [Bio::EnsEMBL::Analysis] not a $conditionAnalysis")
throw("arg must be a [Bio::EnsEMBL::Analysis] not a $conditionAnalysis")
unless ($conditionAnalysis->isa('Bio::EnsEMBL::Analysis'));
$self->throw("analysis arg must be presistent\n")
throw("analysis arg must be presistent\n")
unless($conditionAnalysis->dbID);
my $constraint = "r.condition_analysis_id = '".$conditionAnalysis->dbID."'";
......@@ -97,11 +97,11 @@ sub fetch_by_goal_analysis
my $rule;
my @rules;
$self->throw("arg is required\n")
throw("arg is required\n")
unless($goalAnalysis);
$self->throw("arg must be a [Bio::EnsEMBL::Analysis] not a $goalAnalysis")
throw("arg must be a [Bio::EnsEMBL::Analysis] not a $goalAnalysis")
unless ($goalAnalysis->isa('Bio::EnsEMBL::Analysis'));
$self->throw("analysis arg must be presistent\n")
throw("analysis arg must be presistent\n")
unless($goalAnalysis->dbID);
my $constraint = "r.goal_analysis_id = '".$goalAnalysis->dbID."'";
......@@ -129,11 +129,11 @@ sub fetch_by_condition_and_goal
my $rule;
my @rules;
$self->throw("arg is required\n")
throw("arg is required\n")
unless($goalAnalysis);
$self->throw("arg must be a [Bio::EnsEMBL::Analysis] not a $goalAnalysis")
throw("arg must be a [Bio::EnsEMBL::Analysis] not a $goalAnalysis")
unless ($goalAnalysis->isa('Bio::EnsEMBL::Analysis'));
$self->throw("analysis arg must be presistent\n")
throw("analysis arg must be presistent\n")
unless($goalAnalysis->dbID);
my $constraint = "r.condition_analysis_id = '".$conditionAnalysis->dbID."'";
......@@ -213,7 +213,7 @@ sub remove {
my $dbID = $rule->dbID;
if( !defined $dbID ) {
$self->throw( "SimpleRuleAdaptor->remove called with non persistent SimpleRule" );
throw( "SimpleRuleAdaptor->remove called with non persistent SimpleRule" );
}
my $sth = $self->prepare("DELETE FROM simple_rule WHERE simple_rule_id = $dbID");
......@@ -343,7 +343,7 @@ sub fetch_by_dbID{
my ($self,$id) = @_;
unless(defined $id) {
$self->throw("fetch_by_dbID must have an id");
throw("fetch_by_dbID must have an id");
}
my @tabs = $self->_tables;
......@@ -374,10 +374,10 @@ sub fetch_by_source_stable_id {
my ($self,$source_name, $stable_id) = @_;
unless(defined $source_name) {
$self->throw("fetch_by_source_stable_id must have an source_name");
throw("fetch_by_source_stable_id must have an source_name");
}
unless(defined $stable_id) {
$self->throw("fetch_by_source_stable_id must have an stable_id");
throw("fetch_by_source_stable_id must have an stable_id");
}
my @tabs = $self->_tables;
......
......@@ -40,12 +40,11 @@
package Bio::EnsEMBL::Hive::DataflowRule;
use vars qw(@ISA);
use Bio::EnsEMBL::Root;
use Bio::EnsEMBL::Hive::URLFactory;
use strict;
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
use Bio::EnsEMBL::Hive::URLFactory;
@ISA = qw( Bio::EnsEMBL::Root );
=head2 Constructor
......@@ -60,10 +59,10 @@ use strict;
sub new {
my ($class,@args) = @_;
my $self = $class->SUPER::new(@args);
my $self = bless {}, $class;
my ( $dbID, $adaptor, $fromAnalysis, %fromID, $toAnalysis, $toURL ) =
$self->_rearrange( [ qw (DBID ADAPTOR FROM_ANALYSIS FROM_ID TO_ANALYSIS TO_URL) ], @args );
rearrange( [ qw (DBID ADAPTOR FROM_ANALYSIS FROM_ID TO_ANALYSIS TO_URL) ], @args );
$self->dbID($dbID) if(defined($dbID));
$self->adaptor($adaptor) if(defined($adaptor));
......@@ -149,7 +148,7 @@ sub from_analysis {
# setter mode
if( defined $analysis ) {
unless ($analysis->isa('Bio::EnsEMBL::Analysis')) {
$self->throw(
throw(
"from_analysis arg must be a [Bio::EnsEMBL::Analysis]".
"not a [$analysis]");
}
......@@ -181,7 +180,7 @@ sub to_analysis {
if( defined $analysis ) {
unless ($analysis->isa('Bio::EnsEMBL::Analysis')) {
$self->throw(
throw(
"to_analysis arg must be a [Bio::EnsEMBL::Analysis]".
"not a [$analysis]");
}
......
......@@ -56,16 +56,16 @@
package Bio::EnsEMBL::Hive::Queen;
use strict;
use strict;
use POSIX;
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
use Bio::EnsEMBL::Hive::Worker;
use Bio::EnsEMBL::DBSQL::BaseAdaptor;
use Sys::Hostname;
use Bio::EnsEMBL::Hive::DBSQL::AnalysisCtrlRuleAdaptor;
use Bio::EnsEMBL::Utils::Argument qw(rearrange);
use Bio::EnsEMBL::Utils::Exception qw(throw warning);
our @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
......@@ -396,7 +396,7 @@ sub _fetch_by_hive_id{
my ($self,$id) = @_;
unless(defined $id) {
$self->throw("fetch_by_dbID must have an id");
throw("fetch_by_dbID must have an id");
}
my @tabs = $self->_tables;
......
......@@ -36,11 +36,10 @@
package Bio::EnsEMBL::Hive::SimpleRule;
use vars qw(@ISA);
use Bio::EnsEMBL::Root;
use strict;
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
@ISA = qw( Bio::EnsEMBL::Root );
=head2 Constructor
......@@ -55,10 +54,10 @@ use strict;
sub new {
my ($class,@args) = @_;
my $self = $class->SUPER::new(@args);
my $self = bless {}, $class;
my ( $goal, $adaptor, $dbID, $condition ) =
$self->_rearrange( [ qw (GOAL_ANALYSIS ADAPTOR DBID CONDITION_ANALYSIS) ], @args );
rearrange( [ qw (GOAL_ANALYSIS ADAPTOR DBID CONDITION_ANALYSIS) ], @args );
$self->dbID( $dbID );
$self->conditionAnalysis( $condition );
......@@ -83,7 +82,7 @@ sub conditionAnalysis {
if( defined $analysis ) {
unless ($analysis->isa('Bio::EnsEMBL::Analysis')) {
$self->throw(
throw(
"conditionAnalysis arg must be a [Bio::EnsEMBL::Analysis]".
"not a [$analysis]");
}
......@@ -108,7 +107,7 @@ sub goalAnalysis {
if( defined $analysis ) {
unless ($analysis->isa('Bio::EnsEMBL::Analysis')) {
$self->throw(
throw(
"goalAnalysis arg must be a [Bio::EnsEMBL::Analysis]".
"not a [$analysis]");
}
......
......@@ -38,19 +38,20 @@ my $_URLFactory_global_instance;
package Bio::EnsEMBL::Hive::URLFactory;
use strict;
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
use Bio::EnsEMBL::Hive::Extensions;
use Bio::EnsEMBL::DBSQL::AnalysisAdaptor;
use Bio::EnsEMBL::DBSQL::DBConnection;
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Hive::DBSQL::DBAdaptor;
our @ISA = qw(Bio::EnsEMBL::Root);
sub new
{
my ($class, @args) = @_;
unless($_URLFactory_global_instance) {
$_URLFactory_global_instance = $class->SUPER::new(@args);
$_URLFactory_global_instance = bless {}, $class;
}
return $_URLFactory_global_instance;
}
......
......@@ -61,20 +61,22 @@
package Bio::EnsEMBL::Hive::Worker;
use strict;
use Bio::EnsEMBL::Utils::Argument;
use Bio::EnsEMBL::Utils::Exception;
use Bio::EnsEMBL::Root;
use Bio::EnsEMBL::Analysis;
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Pipeline::RunnableDB;
use Bio::EnsEMBL::Hive::DBSQL::AnalysisJobAdaptor;
use Bio::EnsEMBL::Hive::DBSQL::AnalysisStatsAdaptor;
use Bio::EnsEMBL::Hive::DBSQL::DataflowRuleAdaptor;
use Bio::EnsEMBL::Hive::Extensions;
use vars qw(@ISA);
@ISA = qw(Bio::EnsEMBL::Root);
sub new {
my ($class,@args) = @_;
my $self = bless {}, $class;
return $self;
}
sub init {
my $self = shift;
......@@ -113,7 +115,7 @@ sub analysis {
my $analysis = shift;
if(defined($analysis)) {
$self->throw("analysis arg must be a [Bio::EnsEMBL::Analysis] not a [$analysis]")
throw("analysis arg must be a [Bio::EnsEMBL::Analysis] not a [$analysis]")
unless($analysis->isa('Bio::EnsEMBL::Analysis'));
$self->{'_analysis'} = $analysis;
}
......
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