| 1 | package Bio::Tools::EUtilities::Info; | ||||||||||||||||||||||||||||
| 2 | 2 | $Bio::Tools::EUtilities::Info::VERSION = '1.77'; | |||||||||||||||||||||||||||
| 3 | 2 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use base qw(Bio::Tools::EUtilities Bio::Tools::EUtilities::EUtilDataI); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Bio::Tools::EUtilities::Info::LinkInfo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use Bio::Tools::EUtilities::Info::FieldInfo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | # ABSTRACT: Interface class for storing einfo data. | ||||||||||||||||||||||||||||
| 11 | # AUTHOR: Chris Fields <cjfields@bioperl.org> | ||||||||||||||||||||||||||||
| 12 | # OWNER: 2006-2013 Chris Fields | ||||||||||||||||||||||||||||
| 13 | # LICENSE: Perl_5 | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | # private EUtilDataI method | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 2 | ▶ | sub _add_data { | ||||||||||||||||||||||||||
|
Subroutine
_add_data: called CC=13 SCAR=25.7
| |||||||||||||||||||||||||||||
| 21 | 2 | my ($self, $simple) = @_; | |||||||||||||||||||||||||||
| 22 | 2 | ▶ | if (exists $simple->{DbList} && | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $simple->{"DbList"} and exists $simple->{"DbList"}{"DbName"}
MC/DC50%1/2
exists $simple->{"DbList"} and exists $simple->{"DbList"}{"DbName"}
exists $simple->{"DbList"}
exists $simple->{"DbList"}{"DbName"}
Truth table66%2/3
A and B
A= exists $simple->{"DbList"}B= exists $simple->{"DbList"}{"DbName"}
| |||||||||||||||||||||||||||||
| 23 | exists $simple->{DbList}->{DbName}) { | ||||||||||||||||||||||||||||
| 24 | 1 | $self->{'_available_databases'} = $simple->{DbList}->{DbName}; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | # start setting internal variables | ||||||||||||||||||||||||||||
| 27 | 2 | ▶ | if (exists $simple->{DbInfo}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 1 | for my $key (sort keys %{ $simple->{DbInfo} }) { | |||||||||||||||||||||||||||
| 29 | my $data = | ||||||||||||||||||||||||||||
| 30 | ($key eq 'FieldList') ? $simple->{DbInfo}->{$key}->{Field} : | ||||||||||||||||||||||||||||
| 31 | ($key eq 'LinkList' ) ? $simple->{DbInfo}->{$key}->{Link} : | ||||||||||||||||||||||||||||
| 32 | 7 | ▶ | $simple->{DbInfo}->{$key}; | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 33 | 7 | ▶ | if ($key eq 'FieldList' || $key eq 'LinkList') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$key eq "FieldList" or $key eq "LinkList"
MC/DC100%2/2
$key eq "FieldList" or $key eq "LinkList"
$key eq "FieldList"
$key eq "LinkList"
Truth table100%3/3
A or B
A= $key eq "FieldList"B= $key eq "LinkList"
| |||||||||||||||||||||||||||||
| 34 | 2 | for my $chunk (@{$data}) { | |||||||||||||||||||||||||||
| 35 | 87 | ▶ | if (exists $simple->{DbInfo}->{DbName}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | 87 | $chunk->{DbFrom} = $simple->{DbInfo}->{DbName}; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | 87 | ▶ | my $type = ($key eq 'FieldList') ? 'FieldInfo' : 'LinkInfo'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 39 | 87 | my $obj = "Bio::Tools::EUtilities::Info::$type"->new( | |||||||||||||||||||||||||||
| 40 | -eutil => 'einfo', | ||||||||||||||||||||||||||||
| 41 | -type => lc $type, | ||||||||||||||||||||||||||||
| 42 | -verbose => $self->verbose); | ||||||||||||||||||||||||||||
| 43 | 87 | $obj->_add_data($chunk); | |||||||||||||||||||||||||||
| 44 | 87 | push @{ $self->{'_'.lc $type} }, $obj; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | } else { | ||||||||||||||||||||||||||||
| 47 | 5 | $self->{'_'.lc $key} = $data; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | } else { | ||||||||||||||||||||||||||||
| 51 | 1 | ▶ | map { $self->{'_'.lc $_} = $simple->{$_} unless ref $simple->{$_}} keys %$simple; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | ▶ | sub to_string { | ||||||||||||||||||||||||||
|
Subroutine
to_string: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 57 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 58 | 0 | my $string = $self->SUPER::to_string; | |||||||||||||||||||||||||||
| 59 | 0 | ▶ | if (my @dbs = $self->get_databases) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 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) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 64 | 0 | $string .= $fi->to_string."\n"; | |||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||
| 66 | 0 | ▶ | while (my $li = $self->next_LinkInfo) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | 0 | $string .= $li->to_string."\n"; | |||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||
| 69 | 0 | return $string; | |||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 2 | 1; | |||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | __END__ | ||||||||||||||||||||||||||||