diff --git a/modules/Bio/EnsEMBL/Hive/AnalysisCtrlRule.pm b/modules/Bio/EnsEMBL/Hive/AnalysisCtrlRule.pm index 22e40b194dde053622135098370bd33eddaea52f..2ea30c44a96d9401d432480dbecc6ae6fc72a6f4 100755 --- a/modules/Bio/EnsEMBL/Hive/AnalysisCtrlRule.pm +++ b/modules/Bio/EnsEMBL/Hive/AnalysisCtrlRule.pm @@ -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]"); } diff --git a/modules/Bio/EnsEMBL/Hive/AnalysisJob.pm b/modules/Bio/EnsEMBL/Hive/AnalysisJob.pm index a2f088b111ec5baa3806a2b69a3f59936a3d875a..09d54fae9f46f13ef607b1fdb0ea246529e4f722 100755 --- a/modules/Bio/EnsEMBL/Hive/AnalysisJob.pm +++ b/modules/Bio/EnsEMBL/Hive/AnalysisJob.pm @@ -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; diff --git a/modules/Bio/EnsEMBL/Hive/AnalysisStats.pm b/modules/Bio/EnsEMBL/Hive/AnalysisStats.pm index b1a956253f4ed1f51c8a1f8f5baae361faa97b62..8dc20ba395e79cf96d2af98affc51c5da8278ae1 100755 --- a/modules/Bio/EnsEMBL/Hive/AnalysisStats.pm +++ b/modules/Bio/EnsEMBL/Hive/AnalysisStats.pm @@ -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; diff --git a/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisCtrlRuleAdaptor.pm b/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisCtrlRuleAdaptor.pm index 0a925b78f151177b68822a7291d4e04008971485..8ed9c20637d289f05b4350e6ee03f53f926fa03d 100755 --- a/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisCtrlRuleAdaptor.pm +++ b/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisCtrlRuleAdaptor.pm @@ -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 = '?'"); diff --git a/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm b/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm index b38450527b8a42c188cd9f208b0afc387e0dd69f..1a4d0edd65ac9de3e66cf66c78d0bffc458ea854 100644 --- a/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm +++ b/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisJobAdaptor.pm @@ -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); } diff --git a/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm b/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm index 0b765c77a07b3ecfd714bcdf861db1ef71a94fbc..7f5749cb737eb54ac3dd63e855e9c8711ecb584d 100644 --- a/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm +++ b/modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisStatsAdaptor.pm @@ -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"; diff --git a/modules/Bio/EnsEMBL/Hive/DBSQL/DataflowRuleAdaptor.pm b/modules/Bio/EnsEMBL/Hive/DBSQL/DataflowRuleAdaptor.pm index c2609f6fb0429a2095c0a15e7fd9ef04df70865c..7d7356d311757590cf8382b3a53218dc69979fe2 100755 --- a/modules/Bio/EnsEMBL/Hive/DBSQL/DataflowRuleAdaptor.pm +++ b/modules/Bio/EnsEMBL/Hive/DBSQL/DataflowRuleAdaptor.pm @@ -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; diff --git a/modules/Bio/EnsEMBL/Hive/DBSQL/SimpleRuleAdaptor.pm b/modules/Bio/EnsEMBL/Hive/DBSQL/SimpleRuleAdaptor.pm index 43d78dfaebbc8c8b28ffd7d26395fcd6ef0511d7..90a108e893a8ef98fdc07546dd91a2789e384f09 100755 --- a/modules/Bio/EnsEMBL/Hive/DBSQL/SimpleRuleAdaptor.pm +++ b/modules/Bio/EnsEMBL/Hive/DBSQL/SimpleRuleAdaptor.pm @@ -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; diff --git a/modules/Bio/EnsEMBL/Hive/DataflowRule.pm b/modules/Bio/EnsEMBL/Hive/DataflowRule.pm index 769803ceb0756c5d00a73cb071f0f315616ea0cc..c4a32c5de9c496da7175f3ce74742c75ac2db605 100755 --- a/modules/Bio/EnsEMBL/Hive/DataflowRule.pm +++ b/modules/Bio/EnsEMBL/Hive/DataflowRule.pm @@ -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]"); } diff --git a/modules/Bio/EnsEMBL/Hive/Queen.pm b/modules/Bio/EnsEMBL/Hive/Queen.pm index 29e4041d80ca4a193bb4d59bfaaca7dc6b289aa8..3e887ab2bf15bf7576201abe865f4d460ed5c560 100755 --- a/modules/Bio/EnsEMBL/Hive/Queen.pm +++ b/modules/Bio/EnsEMBL/Hive/Queen.pm @@ -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; diff --git a/modules/Bio/EnsEMBL/Hive/SimpleRule.pm b/modules/Bio/EnsEMBL/Hive/SimpleRule.pm index c57dc8a56a651cb99ebe70da8907e8cd6feecbfb..dc00041637b11f6e4963b30d89b632be89dcc291 100755 --- a/modules/Bio/EnsEMBL/Hive/SimpleRule.pm +++ b/modules/Bio/EnsEMBL/Hive/SimpleRule.pm @@ -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]"); } diff --git a/modules/Bio/EnsEMBL/Hive/URLFactory.pm b/modules/Bio/EnsEMBL/Hive/URLFactory.pm index 143d2a1c43551e44eddba2b7a4c4740955c3d92c..67e3a7c213ecaaeb2a01f3503a44d1bd3447797d 100755 --- a/modules/Bio/EnsEMBL/Hive/URLFactory.pm +++ b/modules/Bio/EnsEMBL/Hive/URLFactory.pm @@ -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; } diff --git a/modules/Bio/EnsEMBL/Hive/Worker.pm b/modules/Bio/EnsEMBL/Hive/Worker.pm index b17a1768a9e004ca48acafe9939e16682750c707..3a2d00f56d29ec59ca8a3344bb2db048e7766dfb 100755 --- a/modules/Bio/EnsEMBL/Hive/Worker.pm +++ b/modules/Bio/EnsEMBL/Hive/Worker.pm @@ -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; }