line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Tools::EUtilities::Info::LinkInfo; |
2
|
|
|
|
|
|
|
$Bio::Tools::EUtilities::Info::LinkInfo::VERSION = '1.77'; |
3
|
8
|
|
|
8
|
|
62
|
use utf8; |
|
8
|
|
|
|
|
19
|
|
|
8
|
|
|
|
|
45
|
|
4
|
8
|
|
|
8
|
|
251
|
use strict; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
172
|
|
5
|
8
|
|
|
8
|
|
40
|
use warnings; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
251
|
|
6
|
8
|
|
|
8
|
|
52
|
use base qw(Bio::Root::Root Bio::Tools::EUtilities::EUtilDataI); |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
6251
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Class for storing einfo link data. |
9
|
|
|
|
|
|
|
# AUTHOR: Chris Fields |
10
|
|
|
|
|
|
|
# OWNER: 2006-2013 Chris Fields |
11
|
|
|
|
|
|
|
# LICENSE: Perl_5 |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new { |
16
|
162
|
|
|
162
|
1
|
1711
|
my ($class, @args) = @_; |
17
|
162
|
|
|
|
|
371
|
my $self = $class->SUPER::new(@args); |
18
|
162
|
|
|
|
|
3717
|
my $eutil = $self->_rearrange([qw(EUTIL)], @args); |
19
|
162
|
|
50
|
|
|
3914
|
$eutil ||= 'einfo'; |
20
|
162
|
|
|
|
|
473
|
$self->eutil($eutil); |
21
|
162
|
|
|
|
|
407
|
$self->datatype('linkinfo'); |
22
|
162
|
|
|
|
|
376
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub get_database { |
27
|
826
|
|
|
826
|
1
|
4364
|
return shift->{'_dbto'}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub get_db { |
32
|
0
|
|
|
0
|
1
|
0
|
return shift->get_database; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub get_dbto { |
37
|
2
|
|
|
2
|
1
|
537
|
return shift->get_database; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
10
|
|
|
10
|
1
|
55
|
sub get_dbfrom { return shift->{'_dbfrom'} } |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub get_link_name { |
45
|
64
|
|
|
64
|
1
|
100
|
my $self = shift; |
46
|
64
|
100
|
|
|
|
138
|
if ($self->eutil eq 'elink') { |
47
|
62
|
|
|
|
|
185
|
return $self->{'_linkname'} |
48
|
|
|
|
|
|
|
} else { |
49
|
2
|
|
|
|
|
29
|
return $self->{'_name'} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
10
|
|
|
10
|
1
|
50
|
sub get_link_description { return shift->{'_description'} } |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub get_link_menu_name { |
58
|
8
|
|
|
8
|
1
|
22
|
my $self = shift; |
59
|
8
|
50
|
|
|
|
25
|
return $self->eutil eq 'elink' ? $self->{'_menutag'} : $self->{'_menu'}; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
10
|
|
|
10
|
1
|
51
|
sub get_priority { return shift->{'_priority'} } |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
10
|
|
|
10
|
1
|
53
|
sub get_html_tag { return shift->{'_htmltag'} } |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
10
|
|
|
10
|
1
|
48
|
sub get_url { return shift->{'_url'} } |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# private method |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub _add_data { |
74
|
162
|
|
|
162
|
|
304
|
my ($self, $simple) = @_; |
75
|
162
|
100
|
|
|
|
390
|
map { $self->{'_'.lc $_} = $simple->{$_} unless ref $simple->{$_}} keys %$simple; |
|
950
|
|
|
|
|
3520
|
|
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub to_string { |
80
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
81
|
0
|
|
0
|
|
|
|
my $level = shift || 0; |
82
|
0
|
|
|
|
|
|
my $pad = 20 - $level; |
83
|
|
|
|
|
|
|
# order method name |
84
|
0
|
|
|
|
|
|
my %tags = (1 => ['get_link_name' => 'Link Name'], |
85
|
|
|
|
|
|
|
2 => ['get_link_description' => 'Description'], |
86
|
|
|
|
|
|
|
3 => ['get_dbfrom' => 'DB From'], |
87
|
|
|
|
|
|
|
4 => ['get_dbto' => 'DB To'], |
88
|
|
|
|
|
|
|
5 => ['get_link_menu_name' => 'Menu Name'], |
89
|
|
|
|
|
|
|
6 => ['get_priority' => 'Priority'], |
90
|
|
|
|
|
|
|
7 => ['get_html_tag' => 'HTML Tag'], |
91
|
|
|
|
|
|
|
8 => ['get_url' => 'URL'], |
92
|
|
|
|
|
|
|
); |
93
|
0
|
|
|
|
|
|
my $string = ''; |
94
|
0
|
|
|
|
|
|
for my $tag (sort {$a <=> $b} keys %tags) { |
|
0
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
my ($m, $nm) = ($tags{$tag}->[0], $tags{$tag}->[1]); |
96
|
0
|
|
|
|
|
|
my $content = $self->$m(); |
97
|
0
|
0
|
|
|
|
|
next unless $content; |
98
|
0
|
|
|
|
|
|
$string .= sprintf("%-*s%-*s%s\n", |
99
|
|
|
|
|
|
|
$level, '', |
100
|
|
|
|
|
|
|
$pad, $nm, |
101
|
|
|
|
|
|
|
$self->_text_wrap(':', |
102
|
|
|
|
|
|
|
' ' x ($pad).':', |
103
|
|
|
|
|
|
|
$content )); |
104
|
|
|
|
|
|
|
} |
105
|
0
|
|
|
|
|
|
return $string; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
1; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
__END__ |