0
|
1 =head1 LICENSE
|
|
2
|
|
3 Copyright (c) 1999-2012 The European Bioinformatics Institute and
|
|
4 Genome Research Limited. All rights reserved.
|
|
5
|
|
6 This software is distributed under a modified Apache license.
|
|
7 For license details, please see
|
|
8
|
|
9 http://www.ensembl.org/info/about/code_licence.html
|
|
10
|
|
11 =head1 CONTACT
|
|
12
|
|
13 Please email comments or questions to the public Ensembl
|
|
14 developers list at <dev@ensembl.org>.
|
|
15
|
|
16 Questions may also be sent to the Ensembl help desk at
|
|
17 <helpdesk@ensembl.org>.
|
|
18
|
|
19 =head1 AUTHOR
|
|
20
|
|
21 Originally from Steve Chervitz. Refactored by Ewan Birney.
|
|
22
|
|
23 =cut
|
|
24
|
|
25 =head1 NAME
|
|
26
|
|
27 Bio::EnsEMBL::Root
|
|
28
|
|
29 =head1 DESCRIPTION
|
|
30
|
|
31 Do not use Bio::EnsEMBL::Root anymore. It is included for backwards
|
|
32 compatibility (every object in EnsEMBL used to inherit from this class)
|
|
33 but will eventually be phased out. The replacement for the _rearrage
|
|
34 method is the rearrange method which can be imported in the following
|
|
35 way:
|
|
36
|
|
37 use Bio::EnsEMBL::Utils::Argument qw(rearrange);
|
|
38
|
|
39 # can now call rearrange as a class method (instead as object method)
|
|
40 my ( $start, $end ) = rearrange( [ 'START', 'END' ], @args );
|
|
41
|
|
42 If you want to use the throw or warn methods the replacement use the
|
|
43 class methods throw and warning from the Bio::EnsEMBL::Utils::Exception
|
|
44 class:
|
|
45
|
|
46 use Bio::EnsEMBL::Utils::Exception qw(throw warning);
|
|
47
|
|
48 # can now call throw or warning even without blessed reference
|
|
49 warning('This is a warning');
|
|
50 throw('This is an exception');
|
|
51
|
|
52 This module was stolen from BioPerl to avoid problems with moving to
|
|
53 BioPerl 1 from 0.7
|
|
54
|
|
55 =head1 METHODS
|
|
56
|
|
57 =cut
|
|
58
|
|
59 package Bio::EnsEMBL::Root;
|
|
60
|
|
61 use strict;
|
|
62 use vars qw($VERBOSITY);
|
|
63 use Bio::EnsEMBL::Utils::Exception qw( );
|
|
64 use Bio::EnsEMBL::Utils::Argument qw( );
|
|
65
|
|
66
|
|
67 $VERBOSITY = 0;
|
|
68
|
|
69 sub new{
|
|
70 my($caller,@args) = @_;
|
|
71
|
|
72 my $class = ref($caller) || $caller;
|
|
73 return bless({}, $class);
|
|
74 }
|
|
75
|
|
76
|
|
77 =head2 throw
|
|
78
|
|
79 DEPRECATED
|
|
80
|
|
81 =cut
|
|
82
|
|
83 sub throw{
|
|
84 my ($self,$string) = @_;
|
|
85
|
|
86 Bio::EnsEMBL::Utils::Exception->warning("\n------------------ DEPRECATED ---------------------\n".
|
|
87 "Bio::EnsEMBL::Root::throw has been deprecated\n".
|
|
88 "use Bio::EnsEMBL::Utils::Exception qw(throw); \n".
|
|
89 "throw('message'); #instead\n".
|
|
90 "\n---------------------------------------------------\n");
|
|
91
|
|
92 Bio::EnsEMBL::Utils::Exception->throw($string);
|
|
93
|
|
94
|
|
95 }
|
|
96
|
|
97 =head2 warn
|
|
98
|
|
99 DEPRECATED
|
|
100
|
|
101 =cut
|
|
102
|
|
103 sub warn{
|
|
104 my ($self,$string) = @_;
|
|
105
|
|
106
|
|
107
|
|
108 Bio::EnsEMBL::Utils::Exception->warning("\n------------------ DEPRECATED ---------------------\n".
|
|
109 "Bio::EnsEMBL::Root::warn has been deprecated\n".
|
|
110 "use Bio::EnsEMBL::Utils::Exception qw(warning); \n".
|
|
111 "warning('message'); #instead\n".
|
|
112 "\n---------------------------------------------------\n");
|
|
113
|
|
114 Bio::EnsEMBL::Utils::Exception->warning($string);
|
|
115
|
|
116 }
|
|
117
|
|
118
|
|
119
|
|
120
|
|
121 =head2 verbose
|
|
122
|
|
123 DEPRECATED
|
|
124
|
|
125 =cut
|
|
126
|
|
127 sub verbose{
|
|
128 my ($self,$value) = @_;
|
|
129
|
|
130 Bio::EnsEMBL::Utils::Exception->warning("\n------------------ DEPRECATED ---------------------\n".
|
|
131 "Bio::EnsEMBL::Root::verbose has been deprecated\n".
|
|
132 "use Bio::EnsEMBL::Utils::Exception qw(verbose); \n".
|
|
133 "verbose(value); #instead\n".
|
|
134 "\n---------------------------------------------------\n");
|
|
135
|
|
136 Bio::EnsEMBL::Utils::Exception->verbose($value);
|
|
137
|
|
138 }
|
|
139
|
|
140 =head2 stack_trace_dump
|
|
141
|
|
142 DEPRECATED
|
|
143
|
|
144 =cut
|
|
145
|
|
146 sub stack_trace_dump{
|
|
147 my ($self) = @_;
|
|
148
|
|
149 Bio::EnsEMBL::Utils::Exception->warning("\n------------------ DEPRECATED ---------------------\n".
|
|
150 "Bio::EnsEMBL::Root::stack_trace_dump has been deprecated\n".
|
|
151 "use Bio::EnsEMBL::Utils::Exception qw(stack_trace_dump); \n".
|
|
152 "stack_trace_dump(); #instead\n".
|
|
153 "\n---------------------------------------------------\n");
|
|
154
|
|
155 Bio::EnsEMBL::Utils::Exception->stack_trace_dump();
|
|
156
|
|
157 }
|
|
158
|
|
159
|
|
160 =head2 stack_trace
|
|
161
|
|
162 DEPRECATED
|
|
163
|
|
164 =cut
|
|
165
|
|
166 sub stack_trace{
|
|
167 my ($self) = @_;
|
|
168
|
|
169 Bio::EnsEMBL::Utils::Exception->warning("\n------------------ DEPRECATED ---------------------\n".
|
|
170 "Bio::EnsEMBL::Root::stack_trace has been deprecated\n".
|
|
171 "use Bio::EnsEMBL::Utils::Exception qw(stack_trace); \n".
|
|
172 "stack_trace(); #instead\n".
|
|
173 "\n---------------------------------------------------\n");
|
|
174
|
|
175 Bio::EnsEMBL::Utils::Exception->stack_trace();
|
|
176
|
|
177 }
|
|
178
|
|
179
|
|
180 =head2 _rearrange
|
|
181
|
|
182 DEPRECATED
|
|
183
|
|
184 =cut
|
|
185
|
|
186 #----------------'
|
|
187 sub _rearrange {
|
|
188 #----------------
|
|
189 my($self,$order,@param) = @_;
|
|
190
|
|
191 my $mess = "use Bio::EnsEMBL::Utils::Argument qw(rearrange); \n";
|
|
192 $mess .= "rearrange(order, list); #instead\n";
|
|
193
|
|
194 Bio::EnsEMBL::Utils::Exception->deprecate($mess);
|
|
195
|
|
196 return Bio::EnsEMBL::Utils::Argument->rearrange($order,@param);
|
|
197
|
|
198 }
|
|
199
|
|
200 1;
|