line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Tools::EUtilities::Info; |
2
|
|
|
|
|
|
|
$Bio::Tools::EUtilities::Info::VERSION = '1.76'; |
3
|
1
|
|
|
1
|
|
525
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
26
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
6
|
1
|
|
|
1
|
|
4
|
use base qw(Bio::Tools::EUtilities Bio::Tools::EUtilities::EUtilDataI); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
86
|
|
7
|
1
|
|
|
1
|
|
400
|
use Bio::Tools::EUtilities::Info::LinkInfo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
8
|
1
|
|
|
1
|
|
375
|
use Bio::Tools::EUtilities::Info::FieldInfo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
443
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Interface class for storing einfo data. |
11
|
|
|
|
|
|
|
# AUTHOR: Chris Fields |
12
|
|
|
|
|
|
|
# OWNER: 2006-2013 Chris Fields |
13
|
|
|
|
|
|
|
# LICENSE: Perl_5 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# private EUtilDataI method |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _add_data { |
21
|
2
|
|
|
2
|
|
6
|
my ($self, $simple) = @_; |
22
|
2
|
50
|
66
|
|
|
10
|
if (exists $simple->{DbList} && |
23
|
|
|
|
|
|
|
exists $simple->{DbList}->{DbName}) { |
24
|
1
|
|
|
|
|
2
|
$self->{'_available_databases'} = $simple->{DbList}->{DbName}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
# start setting internal variables |
27
|
2
|
100
|
|
|
|
8
|
if (exists $simple->{DbInfo}) { |
28
|
1
|
|
|
|
|
4
|
for my $key (sort keys %{ $simple->{DbInfo} }) { |
|
1
|
|
|
|
|
11
|
|
29
|
|
|
|
|
|
|
my $data = |
30
|
|
|
|
|
|
|
($key eq 'FieldList') ? $simple->{DbInfo}->{$key}->{Field} : |
31
|
|
|
|
|
|
|
($key eq 'LinkList' ) ? $simple->{DbInfo}->{$key}->{Link} : |
32
|
7
|
100
|
|
|
|
19
|
$simple->{DbInfo}->{$key}; |
|
|
100
|
|
|
|
|
|
33
|
7
|
100
|
100
|
|
|
67
|
if ($key eq 'FieldList' || $key eq 'LinkList') { |
34
|
2
|
|
|
|
|
4
|
for my $chunk (@{$data}) { |
|
2
|
|
|
|
|
7
|
|
35
|
87
|
50
|
|
|
|
155
|
if (exists $simple->{DbInfo}->{DbName}) { |
36
|
87
|
|
|
|
|
118
|
$chunk->{DbFrom} = $simple->{DbInfo}->{DbName}; |
37
|
|
|
|
|
|
|
} |
38
|
87
|
100
|
|
|
|
148
|
my $type = ($key eq 'FieldList') ? 'FieldInfo' : 'LinkInfo'; |
39
|
87
|
|
|
|
|
185
|
my $obj = "Bio::Tools::EUtilities::Info::$type"->new( |
40
|
|
|
|
|
|
|
-eutil => 'einfo', |
41
|
|
|
|
|
|
|
-type => lc $type, |
42
|
|
|
|
|
|
|
-verbose => $self->verbose); |
43
|
87
|
|
|
|
|
207
|
$obj->_add_data($chunk); |
44
|
87
|
|
|
|
|
121
|
push @{ $self->{'_'.lc $type} }, $obj; |
|
87
|
|
|
|
|
192
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} else { |
47
|
5
|
|
|
|
|
23
|
$self->{'_'.lc $key} = $data; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} else { |
51
|
1
|
50
|
|
|
|
4
|
map { $self->{'_'.lc $_} = $simple->{$_} unless ref $simple->{$_}} keys %$simple; |
|
1
|
|
|
|
|
15
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub to_string { |
57
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
58
|
0
|
|
|
|
|
|
my $string = $self->SUPER::to_string; |
59
|
0
|
0
|
|
|
|
|
if (my @dbs = $self->get_databases) { |
60
|
0
|
|
|
|
|
|
$string .= sprintf("%-20s:%s\n\n", 'DB', |
61
|
|
|
|
|
|
|
$self->_text_wrap('', ' 'x20 .':', join(', ',@dbs))); |
62
|
|
|
|
|
|
|
} |
63
|
0
|
|
|
|
|
|
while (my $fi = $self->next_FieldInfo) { |
64
|
0
|
|
|
|
|
|
$string .= $fi->to_string."\n"; |
65
|
|
|
|
|
|
|
} |
66
|
0
|
|
|
|
|
|
while (my $li = $self->next_LinkInfo) { |
67
|
0
|
|
|
|
|
|
$string .= $li->to_string."\n"; |
68
|
|
|
|
|
|
|
} |
69
|
0
|
|
|
|
|
|
return $string; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
__END__ |