Branch Coverage

blib/lib/Bio/ToolBox/Data.pm
Criterion Covered Total %
branch 108 290 37.2


line true false branch
1114 1 44 if ($args{'stream'})
1124 7 37 if ($args{'file'} and $args{'parse'}) { }
5 32 elsif ($args{'file'}) { }
0 32 elsif (exists $args{'db'} and $args{'features'}) { }
1127 5 2 unless ($self->parse_table(\%args))
1129 0 5 unless $l
1130 5 0 if ($self->database =~ /^Parsed:(.+)$/ and $self->feature_type eq 'named')
1142 0 5 unless ($self->load_file($args{'file'}, $args{'noheader'}))
1152 0 0 if ($args{'features'} eq 'genome') { }
1158 0 0 unless ($result)
1168 1 31 if (defined $args{'columns'}) { }
0 31 elsif (exists $args{'gff'} and $args{'gff'}) { }
0 31 elsif (exists $args{'bed'} and $args{'bed'}) { }
0 31 elsif (exists $args{'ucsc'} and $args{'ucsc'}) { }
1172 0 1 if exists $args{'feature'}
1180 0 0 unless ($self->extension =~ /g[tf]f/)
1182 0 0 $args{'gff'} == 3 ? :
0 0 $args{'gff'} == 2.5 ? :
1187 0 0 unless ($args{'bed'} =~ /^\d{1,2}$/ and $args{'bed'} >= 3)
1192 0 0 unless ($self->extension =~ /bed|peak/)
1199 0 0 unless ($u)
1203 0 0 unless ($self->extension =~ /ucsc|ref+lat|genepred/)
1217 0 1 unless my $Dupe = $self->new('columns', $columns)
1241 12 6 if (ref $args) { }
1246 0 12 exists $args->{'simplify'} && defined $args->{'simplify'} ? :
1256 0 18 unless ($file)
1262 5 13 unless my $flavor = $self->taste_file($file)
1265 0 13 if ($@)
1271 0 13 unless my $parser = $class->new
1272 0 13 unless $parser->open_file($file)
1276 6 7 unless ($feature)
1277 2 4 if ($typelist =~ /gene/i) { }
3 1 elsif ($typelist eq 'region') { }
1290 2 11 if ($subfeature)
1291 1 1 if $subfeature =~ /exon/i
1292 1 1 if $subfeature =~ /cds/i
1293 0 2 if $subfeature =~ /utr|untranslated/i
1294 0 2 if $subfeature =~ /codon/i
1296 4 9 if ($feature =~ /gene$/i) { }
1303 0 1 if (lc $feature eq 'mrna' and not $parser->typelist =~ /mrna/i and not $self->last_row)
1312 0 13 unless $parser->parse_file
1315 5 8 if ($self->last_row > 0) { }
1324 65 0 if ($f)
1329 0 5 unless ($count == $self->last_row)
1345 2 6 if ($args)
1351 0 120 if ($chr_exclude)
1352 0 0 if $f->seq_id =~ /$chr_exclude/i
1355 113 7 if ($f->type =~ /$feature/i or $mrna_check and is_coding($f))
1360 0 8 unless ($self->last_row)
1366 0 8 if $chr_exclude
1385 0 2 unless defined $column
1386 0 2 unless exists $self->{$column}{'name'}
1388 0 2 wantarray ? :
1393 0 28 unless $name
1398 2 26 if ($name_ref eq 'ARRAY') { }
0 26 elsif ($name_ref eq 'Bio::DB::GFF::Typename') { }
26 0 elsif ($name_ref eq '') { }
1399 2 0 if ($self->last_row > 1) { }
1401 2 0 if ($self->last_row == scalar @$name - 1) { }
1452 0 28 if exists $self->{'column_indices'}
1453 0 28 if ($self->gff or $self->bed or $self->ucsc or $self->vcf)
1463 0 1 unless defined $index
1477 191 40 if ($_[0] and ref $_[0] eq 'ARRAY') { }
40 0 elsif ($_[0] and ref $_[0] eq 'Bio::ToolBox::Data::Feature') { }
0 0 elsif ($_[0] and $_[0] =~ /\t/) { }
1489 0 231 if (scalar @row_data > $self->{'number_columns'})
1504 0 5 unless defined $self->{'data_table'}[$row_number]
1509 4 1 if (exists $self->{'SeqFeatureObjects'} and defined $self->{'SeqFeatureObjects'}[$row_number])
1525 0 1 if (exists $self->{'SeqFeatureObjects'})
1535 237 0 wantarray ? :
1540 0 508 unless defined $row and defined $column
1541 0 508 if (defined $value)
1555 0 6 unless (ref $code eq 'CODE')
1570 0 178 unless (defined $row_i and ref $seqfeature)
1573 0 178 unless $row_i <= $self->last_row
1581 0 0 unless $row_i <= $self->last_row
1582 0 0 unless $self->{'SeqFeatureObjects'}
1588 0 0 unless ($self->feature_type eq 'named')
1596 0 0 if ($@)
1603 0 0 if (exists $self->{'SeqFeatureObjects'}) { }
1606 0 0 unless my $feature = $self->{'SeqFeatureObjects'}[$i]
1607 0 0 unless my $collSeqFeat = collapse_transcripts($feature)
1614 0 0 unless my $db = $self->open_meta_database(1)
1620 0 0 unless my $feature = get_db_feature('db', $db, 'name', $self->value($i, $name_i) || undef, 'type', $self->value($i, $type_i) || undef, 'id', $self->value($i, $id_i) || undef)
1626 0 0 unless my $collSeqFeat = collapse_transcripts($feature)
1637 0 0 unless (exists $self->{'SeqFeatureObjects'})
1645 0 0 if ($@)
1653 0 0 if ($subfeature eq 'exon') { }
0 0 elsif ($subfeature eq 'cds') { }
0 0 elsif ($subfeature eq '5p_utr') { }
0 0 elsif ($subfeature eq '3p_utr') { }
1676 0 0 if (exists $self->{'SeqFeatureObjects'}) { }
1679 0 0 unless my $feature = $self->{'SeqFeatureObjects'}[$i]
1687 0 0 unless my $db = $self->open_meta_database(1)
1693 0 0 unless my $feature = get_db_feature('db', $db, 'name', $self->value($i, $name_i) || undef, 'type', $self->value($i, $type_i) || undef, 'id', $self->value($i, $id_i) || undef)
1720 0 1 unless exists $self->{$index}{'name'}
1721 0 1 unless ($direction =~ /^[id]/i)
1733 1 0 if (defined $v and not $v =~ m[^(?:\.|n/?a|nan|\-?inf)$]i)
1742 1 0 if ($example =~ /[a-z]/i) { }
0 0 elsif ($example =~ /^\-?\d+\.?\d*$/) { }
1766 0 1 if ($sortmethod eq 'numeric') { }
1 0 elsif ($sortmethod eq 'ascii') { }
1786 0 0 if ($direction =~ /^i/i) { }
1815 0 78 if (exists $datahash{$value}) { }
1835 0 1 if ($direction eq 'i' or $direction eq 'I') { }
1 0 elsif ($direction eq 'd' or $direction eq 'D') { }
1866 0 1 unless ($self->feature_type eq 'coordinate')
1888 0 78 if ($self->value($row, $chromo_i) =~ /^(?:chr)?(\d+)$/) { }
1944 0 1 unless ($part and $total_parts)
1950 0 1 if (exists $self->{'SeqFeatureObjects'})
1958 0 1 if ($part == 1) { }
1 0 elsif ($part == $total_parts) { }
1964 0 0 if (exists $self->{'SeqFeatureObjects'})
1978 0 1 if (exists $self->{'SeqFeatureObjects'})
2002 0 0 if (exists $self->{'SeqFeatureObjects'})
2019 0 1 if (exists $self->{'db_connection'})
2032 0 1 unless @files
2037 0 1 if ($@)
2045 0 1 unless ($Stream)
2081 0 2 if ($Stream->number_columns != $self->number_columns)
2111 0 0 if ($args{'dataset'} and ref $args{'dataset'} eq 'ARRAY') { }
0 0 elsif ($args{'dataset'} and ref $args{'dataset'} eq 'SCALAR') { }
2118 0 0 if ($args{'startcolumn'} and ref $args{'startcolumn'} eq 'ARRAY') { }
0 0 elsif ($args{'startcolumn'} and ref $args{'startcolumn'} eq 'SCALAR') { }
2126 0 0 if ($args{'endcolumn'} and ref $args{'endcolumn'} eq 'ARRAY') { }
0 0 elsif ($args{'endcolumn'} and ref $args{'endcolumn'} eq 'SCALAR') { }
2135 0 0 unless ($self->verify)
2139 0 0 unless (defined $outfile)
2140 0 0 if ($self->basename) { }
2161 0 0 unless (exists $skip{lc $self->{$i}{'name'}})
2163 0 0 if (defined $d) { }
2176 0 0 unless (@datasets)
2177 0 0 if (scalar keys %possibles > 1)
2186 0 0 if (scalar @startcolumns != scalar @datasets)
2195 0 0 if (scalar @endcolumns != scalar @datasets)
2239 0 0 if (substr($self->name($column), -1) eq '%')
2243 0 0 if ($do_percentile and substr($self->name($column), -2) eq 'bp')
2252 0 0 $v eq '.' ? :
2257 0 0 if ($log)
2263 0 0 if ($log)
2268 0 0 if ($d == 0) { }
2275 0 0 if ($summed_data->value($row, 1) != $midpoint)
2317 6 148 if $self->{'index'} > $self->{'data'}{'last_row'}
2324 0 148 if (exists $self->{'data'}{'SeqFeatureObjects'} and defined $self->{'data'}{'SeqFeatureObjects'}[$i])
2335 0 0 if @_