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