DB/EUtilities.pm

filter: Statementstmt 14.9% 22 / 147 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 10.0% 6 / 60 Podpod 100% 54 / 54 totaltotal 29.7% 82 / 276 CC 7 SCAR 12.7
CC
7
Cov
14%
get_Parser
20.0
get_parameter_values
12.0
get_Response
6.0
CRAP 3.6
« Tools/EUtilities/Info/LinkInfo.pm ↑ Summary Tools/EUtilities/Info/FieldInfo.pm »
1 package Bio::DB::EUtilities;
2 1 $Bio::DB::EUtilities::VERSION = '1.77';
3 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use base qw(Bio::DB::GenericWebAgent);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Bio::Tools::EUtilities::EUtilParameters;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Bio::Tools::EUtilities;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # ABSTRACT: Webagent which interacts with and retrieves data from NCBI's eUtils.
11 # AUTHOR: Chris Fields <cjfields@bioperl.org>
12 # OWNER: 2006-2013 Chris Fields
13 # LICENSE: Perl_5
14  
15  
16  
17 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
18 0 my($class,@args) = @_;
19 0 my $self = $class->SUPER::new(@args);
20 0 my $params = Bio::Tools::EUtilities::EUtilParameters->new(-verbose => $self->verbose,
21 @args);
22 # cache parameters
23 0 $self->parameter_base($params);
24 0 return $self;
25 }
26  
27  
28  
29  
30  
31 0 ▶sub get_Response {
Subroutine get_Response: not called CC=2 SCAR=17.9
Pod documented
32 0 my $self = shift;
33 0 ▶ $self->parameter_base->email() || $self->warn('The -email parameter is now required, per NCBI E-utilities policy');
Branch: 1 branch
BranchTrueFalseTotal
$self->parameter_base->email or $self->warn("The -email parameter is now required, per NCBI E-utilities policy") 0 0 0
34 0 $self->SUPER::get_Response(@_);
35 }
36  
37  
38  
39  
40  
41 0 ▶sub delay_policy {
Subroutine delay_policy: not called CC=1 SCAR=6.9
Pod documented
42 0 my $self = shift;
43 0 return 1/3;
44 }
45  
46  
47 0 ▶sub get_Parser {
Subroutine get_Parser: not called CC=4 SCAR=30.0
Pod documented
48 0 my ($self) = @_;
49 0 my $pobj = $self->parameter_base;
50 0 ▶ if ($pobj->parameters_changed || !$self->{'_parser'}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pobj->parameters_changed or not $self->{"_parser"}) 0 0 0
Condition0%0/3
$pobj->parameters_changed or not $self->{"_parser"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$pobj->parameters_changed or not $self->{"_parser"}
$pobj->parameters_changed not $self->{"_parser"}
Truth table0%0/3
A or not(B)
A= $pobj->parameters_changedB= not $self->{"_parser"}
ABresult
1X1
011
000
51 0 my $eutil = $pobj->eutil ;
52 0 ▶ if ($eutil eq 'efetch') {
Branch: 1 branch
BranchTrueFalseTotal
if ($eutil eq "efetch") 0 0 0
53 0 $self->throw("No parser defined for efetch; use get_Response() directly");
54 };
55 # if we are to add pipe/tempfile support this would probably be the
56 # place to add it....
57 0 my $parser = Bio::Tools::EUtilities->new(
58 -eutil => $eutil,
59 -response => $self->get_Response,
60 -parameters => $pobj,
61 -verbose => $self->verbose);
62 0 return $self->{'_parser'} = $parser;
63 }
64 0 return $self->{'_parser'};
65 }
66  
67  
68  
69 0 ▶sub set_parameters {
Subroutine set_parameters: not called CC=1 SCAR=6.9
Pod documented
70 0 my ($self, @args) = @_;
71 # just ensures that parser instance isn't reused
72 0 delete $self->{'_parser'};
73 0 $self->parameter_base->set_parameters(@args);
74 }
75  
76  
77 0 ▶sub reset_parameters {
Subroutine reset_parameters: not called CC=1 SCAR=6.9
Pod documented
78 0 my ($self, @args) = @_;
79 # just ensures that parser instance isn't reused
80 0 delete $self->{'_parser'};
81 0 $self->parameter_base->reset_parameters(@args);
82 }
83  
84  
85 0 ▶sub available_parameters {
Subroutine available_parameters: not called CC=1 SCAR=6.9
Pod documented
86 0 my ($self, @args) = @_;
87 0 return $self->parameter_base->available_parameters(@args);
88 }
89  
90  
91 0 ▶sub get_parameters {
Subroutine get_parameters: not called CC=1 SCAR=6.9
Pod documented
92 0 my ($self, @args) = @_;
93 0 return $self->parameter_base->get_parameters(@args);
94 }
95  
96  
97 0 ▶sub get_parameter_values {
Subroutine get_parameter_values: not called CC=3 SCAR=24.8
Pod documented
98 0 my ($self, $p) = @_;
99 0 my %params = $self->parameter_base->get_parameters(-list => [$p]);
100 0 ▶ if (exists $params{$p}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $params{$p}) 0 0 0
101 0 ▶ return ref $params{$p} eq 'ARRAY' ? @{$params{$p}} : $params{$p};
Branch: 1 branch
BranchTrueFalseTotal
ref $params{$p} eq 'ARRAY' ? : 0 0 0
102 }
103 0 return;
104 }
105  
106  
107  
108 0 ▶sub eutil {
Subroutine eutil: not called CC=1 SCAR=6.9
Pod documented
109 0 my ($self, @args) = @_;
110 0 return $self->get_Parser->eutil(@args);
111 }
112  
113  
114 0 ▶sub datatype {
Subroutine datatype: not called CC=1 SCAR=6.9
Pod documented
115 0 my ($self, @args) = @_;
116 0 return $self->get_Parser->datatype(@args);
117 }
118  
119  
120 0 ▶sub to_string {
Subroutine to_string: not called CC=1 SCAR=6.9
Pod documented
121 0 my ($self, @args) = @_;
122 0 return $self->get_Parser->to_string(@args);
123 }
124  
125  
126 0 ▶sub print_all {
Subroutine print_all: not called CC=1 SCAR=6.9
Pod documented
127 0 my ($self, @args) = @_;
128 0 return $self->get_Parser->print_all(@args);
129 }
130  
131  
132 0 ▶sub get_ids {
Subroutine get_ids: not called CC=1 SCAR=6.9
Pod documented
133 0 my ($self, @args) = @_;
134 0 return $self->get_Parser->get_ids(@args);
135 }
136  
137  
138 0 ▶sub get_database {
Subroutine get_database: not called CC=1 SCAR=6.9
Pod documented
139 0 my ($self, @args) = @_;
140 0 return $self->get_Parser->get_database(@args);
141 }
142  
143  
144 0 ▶sub get_db {
Subroutine get_db: not called CC=1 SCAR=6.9
Pod documented
145 0 my ($self, @args) = @_;
146 0 return $self->get_Parser->get_db(@args);
147 }
148  
149  
150 0 ▶sub get_databases {
Subroutine get_databases: not called CC=1 SCAR=6.9
Pod documented
151 0 my ($self, @args) = @_;
152 0 return $self->get_Parser->get_databases(@args);
153 }
154  
155  
156 0 ▶sub get_dbs {
Subroutine get_dbs: not called CC=1 SCAR=6.9
Pod documented
157 0 my ($self, @args) = @_;
158 0 return $self->get_Parser->get_databases(@args);
159 }
160  
161  
162 0 ▶sub next_History {
Subroutine next_History: not called CC=1 SCAR=6.9
Pod documented
163 0 my ($self, @args) = @_;
164 0 return $self->get_Parser->next_History(@args);
165 }
166  
167  
168 0 ▶sub next_cookie {
Subroutine next_cookie: not called CC=1 SCAR=6.9
Pod documented
169 0 my ($self, @args) = @_;
170 0 return $self->get_Parser->next_History(@args);
171 }
172  
173  
174 0 ▶sub get_Histories {
Subroutine get_Histories: not called CC=1 SCAR=6.9
Pod documented
175 0 my ($self, @args) = @_;
176 0 return $self->get_Parser->get_Histories(@args);
177 }
178  
179  
180 0 ▶sub get_count {
Subroutine get_count: not called CC=1 SCAR=6.9
Pod documented
181 0 my ($self, @args) = @_;
182 0 return $self->get_Parser->get_count(@args);
183 }
184  
185  
186 0 ▶sub get_term {
Subroutine get_term: not called CC=1 SCAR=6.9
Pod documented
187 0 my ($self, @args) = @_;
188 0 return $self->get_Parser->get_term(@args);
189 }
190  
191  
192 0 ▶sub get_translation_from {
Subroutine get_translation_from: not called CC=1 SCAR=6.9
Pod documented
193 0 my ($self, @args) = @_;
194 0 return $self->get_Parser->get_translation_from(@args);
195 }
196  
197  
198 0 ▶sub get_translation_to {
Subroutine get_translation_to: not called CC=1 SCAR=6.9
Pod documented
199 0 my ($self, @args) = @_;
200 0 return $self->get_Parser->get_translation_to(@args);
201 }
202  
203  
204 0 ▶sub get_retstart {
Subroutine get_retstart: not called CC=1 SCAR=6.9
Pod documented
205 0 my ($self, @args) = @_;
206 0 return $self->get_Parser->get_retstart(@args);
207 }
208  
209  
210 0 ▶sub get_retmax {
Subroutine get_retmax: not called CC=1 SCAR=6.9
Pod documented
211 0 my ($self, @args) = @_;
212 0 return $self->get_Parser->get_retmax(@args);
213 }
214  
215  
216 0 ▶sub get_query_translation {
Subroutine get_query_translation: not called CC=1 SCAR=6.9
Pod documented
217 0 my ($self, @args) = @_;
218 0 return $self->get_Parser->get_query_translation(@args);
219 }
220  
221  
222 0 ▶sub get_corrected_query {
Subroutine get_corrected_query: not called CC=1 SCAR=6.9
Pod documented
223 0 my ($self, @args) = @_;
224 0 return $self->get_Parser->get_corrected_query(@args);
225 }
226  
227  
228 0 ▶sub get_replaced_terms {
Subroutine get_replaced_terms: not called CC=1 SCAR=6.9
Pod documented
229 0 my ($self, @args) = @_;
230 0 return $self->get_Parser->get_replaced_terms(@args);
231 }
232  
233  
234 0 ▶sub next_GlobalQuery {
Subroutine next_GlobalQuery: not called CC=1 SCAR=6.9
Pod documented
235 0 my ($self, @args) = @_;
236 0 return $self->get_Parser->next_GlobalQuery(@args);
237 }
238  
239  
240 0 ▶sub get_GlobalQueries {
Subroutine get_GlobalQueries: not called CC=1 SCAR=6.9
Pod documented
241 0 my ($self, @args) = @_;
242 0 return $self->get_Parser->get_GlobalQueries(@args);
243 }
244  
245  
246 0 ▶sub print_GlobalQueries {
Subroutine print_GlobalQueries: not called CC=1 SCAR=6.9
Pod documented
247 0 my ($self, @args) = @_;
248 0 return $self->get_Parser->print_GlobalQueries(@args);
249 }
250  
251  
252 0 ▶sub next_DocSum {
Subroutine next_DocSum: not called CC=1 SCAR=6.9
Pod documented
253 0 my ($self, @args) = @_;
254 0 return $self->get_Parser->next_DocSum(@args);
255 }
256  
257  
258 0 ▶sub get_DocSums {
Subroutine get_DocSums: not called CC=1 SCAR=6.9
Pod documented
259 0 my ($self, @args) = @_;
260 0 return $self->get_Parser->get_DocSums(@args);
261 }
262  
263  
264 0 ▶sub print_DocSums {
Subroutine print_DocSums: not called CC=1 SCAR=6.9
Pod documented
265 0 my ($self, @args) = @_;
266 0 return $self->get_Parser->print_DocSums(@args);
267 }
268  
269  
270 0 ▶sub get_available_databases {
Subroutine get_available_databases: not called CC=1 SCAR=6.9
Pod documented
271 0 my ($self, @args) = @_;
272 0 return $self->get_Parser->get_available_databases(@args);
273 }
274  
275  
276 0 ▶sub get_record_count {
Subroutine get_record_count: not called CC=1 SCAR=6.9
Pod documented
277 0 my ($self, @args) = @_;
278 0 return $self->get_Parser->get_record_count(@args);
279 }
280  
281  
282 0 ▶sub get_last_update {
Subroutine get_last_update: not called CC=1 SCAR=6.9
Pod documented
283 0 my ($self, @args) = @_;
284 0 return $self->get_Parser->get_last_update(@args);
285 }
286  
287  
288 0 ▶sub get_menu_name {
Subroutine get_menu_name: not called CC=1 SCAR=6.9
Pod documented
289 0 my ($self, @args) = @_;
290 0 return $self->get_Parser->get_menu_name(@args);
291 }
292  
293  
294 0 ▶sub get_description {
Subroutine get_description: not called CC=1 SCAR=6.9
Pod documented
295 0 my ($self, @args) = @_;
296 0 return $self->get_Parser->get_description(@args);
297 }
298  
299  
300 0 ▶sub next_FieldInfo {
Subroutine next_FieldInfo: not called CC=1 SCAR=6.9
Pod documented
301 0 my ($self, @args) = @_;
302 0 return $self->get_Parser->next_FieldInfo(@args);
303 }
304  
305  
306 0 ▶sub get_FieldInfo {
Subroutine get_FieldInfo: not called CC=1 SCAR=6.9
Pod documented
307 0 my ($self, @args) = @_;
308 0 return $self->get_Parser->get_FieldInfo(@args);
309 }
310  
311 1 *get_FieldInfos = \&get_FieldInfo;
312  
313  
314 0 ▶sub next_LinkInfo {
Subroutine next_LinkInfo: not called CC=1 SCAR=6.9
Pod documented
315 0 my ($self, @args) = @_;
316 0 return $self->get_Parser->next_LinkInfo(@args);
317 }
318  
319  
320 0 ▶sub get_LinkInfo {
Subroutine get_LinkInfo: not called CC=1 SCAR=6.9
Pod documented
321 0 my ($self, @args) = @_;
322 0 return $self->get_Parser->get_LinkInfo(@args);
323 }
324  
325 1 *get_LinkInfos = \&get_LinkInfo;
326  
327  
328 0 ▶sub print_FieldInfo {
Subroutine print_FieldInfo: not called CC=1 SCAR=6.9
Pod documented
329 0 my ($self, @args) = @_;
330 0 return $self->get_Parser->print_FieldInfo(@args);
331 }
332  
333  
334 0 ▶sub print_LinkInfo {
Subroutine print_LinkInfo: not called CC=1 SCAR=6.9
Pod documented
335 0 my ($self, @args) = @_;
336 0 return $self->get_Parser->print_LinkInfo(@args);
337 }
338  
339  
340 0 ▶sub next_LinkSet {
Subroutine next_LinkSet: not called CC=1 SCAR=6.9
Pod documented
341 0 my ($self, @args) = @_;
342 0 return $self->get_Parser->next_LinkSet(@args);
343 }
344  
345  
346 # add support for retrieval of data if lazy parsing is enacted
347  
348 0 ▶sub get_LinkSets {
Subroutine get_LinkSets: not called CC=1 SCAR=6.9
Pod documented
349 0 my ($self, @args) = @_;
350 0 return $self->get_Parser->get_LinkSets(@args);
351 }
352  
353  
354 0 ▶sub print_LinkSets {
Subroutine print_LinkSets: not called CC=1 SCAR=6.9
Pod documented
355 0 my ($self, @args) = @_;
356 0 return $self->get_Parser->print_LinkSets(@args);
357 }
358  
359  
360 0 ▶sub get_linked_databases {
Subroutine get_linked_databases: not called CC=1 SCAR=6.9
Pod documented
361 0 my ($self, @args) = @_;
362 0 return $self->get_Parser->get_linked_databases(@args);
363 }
364  
365  
366  
367 0 ▶sub rewind {
Subroutine rewind: not called CC=1 SCAR=6.9
Pod documented
368 0 my ($self, $string) = @_;
369 0 return $self->get_Parser->rewind($string);
370 }
371  
372  
373 0 ▶sub generate_iterator {
Subroutine generate_iterator: not called CC=1 SCAR=6.9
Pod documented
374 0 my ($self, @args) = @_;
375 0 return $self->get_Parser->generate_iterator(@args);
376 }
377  
378  
379 0 ▶sub callback {
Subroutine callback: not called CC=1 SCAR=6.9
Pod documented
380 0 my ($self, @args) = @_;
381 0 return $self->get_Parser->callback(@args);
382 }
383  
384 1 1;
385  
386 __END__
« Tools/EUtilities/Info/LinkInfo.pm ↑ Summary Tools/EUtilities/Info/FieldInfo.pm »