Branch Coverage

blib/lib/Bio/ToolBox/Data/Feature.pm
Criterion Covered Total %
branch 139 490 28.3


line true false branch
1028 0 0 unless defined $column
1034 0 24 if @_
1040 0 65 if @_
1046 0 0 if @_
1047 0 0 if (exists $self->{'data'}{'line_count'}) { }
0 0 elsif (exists $self->{'data'}{'header_line_count'}) { }
1060 0 196 if @_
1063 118 78 wantarray ? :
1068 0 341 unless defined $column
1071 85 256 if (defined $value)
1076 340 1 CORE::length $v ? :
1081 1 20 if ($_[0])
1084 1 0 if (defined $i) { }
0 0 elsif (exists $self->{'feature'}) { }
1097 15 6 if exists $self->{'seqid'}
1103 6 0 if (defined $i) { }
0 0 elsif (exists $self->{'feature'}) { }
0 0 elsif (defined $j) { }
0 0 elsif ($self->feature_type eq 'named') { }
1117 0 0 if ($f)
1121 6 0 if defined $c
1127 5 114 if ($_[0])
1130 5 0 $_[0] =~ /^\d+$/ ? :
1131 1 4 if (defined $i and $d) { }
0 4 elsif (not $d) { }
4 0 elsif (exists $self->{'feature'}) { }
1132 1 0 if ($self->{'data'}->interbase) { }
1154 27 92 if exists $self->{'start'}
1160 87 5 if (defined $i) { }
5 0 elsif (exists $self->{'feature'}) { }
0 0 elsif (defined $j) { }
0 0 elsif ($self->feature_type eq 'named') { }
1163 6 81 if ($self->{'data'}->interbase)
1178 0 0 if ($f)
1182 92 0 if defined $s
1189 2 36 if ($_[0])
1192 2 0 $_[0] =~ /^\d+$/ ? :
1193 2 0 if (defined $i and $d) { }
0 0 elsif (not $d) { }
0 0 elsif (exists $self->{'feature'}) { }
1209 27 11 if exists $self->{'end'}
1215 10 1 if (defined $i) { }
1 0 elsif (exists $self->{'feature'}) { }
0 0 elsif (defined $j) { }
0 0 elsif ($self->feature_type eq 'named') { }
1229 0 0 if ($f)
1233 11 0 if defined $e
1239 1 28 if ($_[0])
1242 0 1 if (defined $i) { }
0 1 elsif (exists $self->{'feature'}) { }
1255 22 7 if exists $self->{'strand'}
1259 2 5 if (my $i = $self->{'data'}->strand_column) { }
4 1 elsif (exists $self->{'feature'}) { }
0 1 elsif ($self->feature_type eq 'named') { }
1269 0 0 if ($f)
1280 0 2 if ($str eq '1' or $str eq '-1' or $str eq '0') { }
0 2 elsif ($str eq '+') { }
2 0 elsif ($str eq '-') { }
0 0 elsif ($str eq '.') { }
0 0 elsif ($str eq '2') { }
0 0 elsif ($str eq '*') { }
1308 0 0 unless exists $self->{'seqid'}
1309 0 0 unless exists $self->{'start'}
1311 0 0 unless exists $self->{'end'}
1312 0 0 if (defined $str and not exists $self->{'strand'})
1320 2 1 if ($self->{'data'}->format eq 'narrowPeak') { }
1321 1 1 if (exists $self->{'feature'} and $self->{'feature'}->has_tag('peak')) { }
1337 5 0 if ($s and $e) { }
1348 1 75 if ($_[0])
1351 1 0 if (defined $i) { }
0 0 elsif (exists $self->{'feature'}) { }
1362 5 70 if (exists $self->{'feature'})
1367 70 0 if (defined $i) { }
0 0 elsif (my $att = $self->gff_attributes) { }
1378 0 3 if @_
1384 0 0 exists $self->{'feature'} ? :
3 0 defined $start_i ? :
1386 3 0 if $end
1387 3 0 CORE::length $coord > 2 ? :
1392 1 8 if ($_[0])
1395 0 1 if (defined $i) { }
0 1 elsif (exists $self->{'feature'}) { }
1407 0 9 if (defined $i)
1411 4 5 if (exists $self->{'feature'})
1415 5 0 if ($self->{'data'}->feature)
1424 0 66 if @_
1426 66 0 if defined $i
1427 66 0 if (defined $v and $v ne ".")
1430 0 0 if exists $self->{'feature'}
1431 0 0 if (my $att = $self->gff_attributes)
1439 0 2 if @_
1440 0 2 if ($self->{'data'}->vcf)
1446 2 0 if (defined $s and defined $e) { }
0 0 elsif (defined $s) { }
1460 0 0 defined $c ? :
1465 0 0 if $self->{'data'}->gff
1466 0 0 if $self->{'data'}->vcf
1472 0 1 unless $self->{'data'}->gff
1473 0 1 if exists $self->{'attributes'}
1477 0 3 unless $tag and $value
1488 0 0 unless $self->{'data'}->vcf
1489 0 0 if exists $self->{'attributes'}
1494 0 0 if ($self->{'data'}->name(7) eq "INFO")
1495 0 0 defined $_->[1] ? :
1504 0 0 if ($self->{'data'}->number_columns > 8)
1510 0 0 defined $sampleVals[$_] ? :
1521 0 0 if $self->{'data'}->gff
1522 0 0 if $self->{'data'}->vcf
1528 0 1 unless $self->{'data'}->gff
1529 0 1 unless exists $self->{'attributes'}
1531 1 0 if (exists $self->{'attributes'}{'ID'})
1535 1 0 if (exists $self->{'attributes'}{'Name'})
1541 1 2 if $key eq "ID"
1542 1 1 if $key eq "Name"
1554 0 0 unless $self->{'data'}->vcf
1555 0 0 unless exists $self->{'attributes'}
1561 0 0 defined $self->{'attributes'}{'INFO'}{$_} ? :
1571 0 0 if exists $self->{'attributes'}{'9'}{'GT'}
1573 0 0 if $key eq "GT"
1576 0 0 if (@order) { }
1585 0 0 if (@order) { }
1603 0 4 if @_
1604 0 4 if exists $self->{'feature'}
1607 4 0 unless $self->feature_type eq "named" or $force
1611 0 0 if ($f)
1617 0 0 unless $self->{'data'}->database
1624 0 0 unless $f
1631 0 1 if @_
1632 0 1 unless $self->{'data'}->database
1633 1 0 if ($self->feature_type eq 'coordinate') { }
0 0 elsif ($self->feature_type eq 'named') { }
1638 1 0 $db ? :
1642 0 0 $f ? :
1653 0 0 unless defined $db
1654 0 0 unless $db->can("features")
1674 0 0 if ($self->feature_type eq "named" and $args{'subfeature'})
1684 0 0 if (exists $args{'strand'})
1686 0 0 $args{'strand'} =~ /\-|r/i ? :
1688 0 0 if (exists $args{'extend'} and $args{'extend'})
1690 0 0 if $start <= 0
1693 0 0 unless defined $seqid and defined $start and defined $stop
1697 0 0 if ($strand == -1)
1709 0 0 unless (@$subfeatures)
1720 0 0 unless $Bio::ToolBox::Data::Feature::a->[1] <=> $Bio::ToolBox::Data::Feature::b->[1]
1732 0 0 if ($self->strand == -1)
1744 0 0 unless ($GENETOOL_LOADED)
1747 0 0 if ($@) { }
1757 0 0 unless $feature
1761 0 0 if ($subf eq 'exon') { }
0 0 elsif ($subf eq 'cds') { }
0 0 elsif ($subf eq '5p_utr') { }
0 0 elsif ($subf eq '3p_utr') { }
0 0 elsif ($subf eq 'intron') { }
1790 0 7 unless ($args{'dataset'})
1796 0 0 if ($self->feature_type eq "named" and $args{'subfeature'})
1805 7 0 if ($self->feature_type eq 'coordinate') { }
0 0 elsif ($self->feature_type eq 'named') { }
1811 0 7 exists $args{'strand'} && defined $args{'strand'} ? :
1816 0 0 unless $f
1821 0 0 exists $args{'strand'} && defined $args{'strand'} ? :
1828 0 0 if (exists $args{'extend'} and $args{'extend'})
1834 0 7 if $params[1] <= 0
1835 0 7 if ($params[2] < $params[1])
1837 0 0 if $params[2] <= 0
1843 0 7 unless $params[0] and defined $params[1]
1863 0 0 unless (@$subfeatures)
1867 0 0 if exists $args->{'exon'}
1878 0 0 defined $args->{'strand'} ? :
1886 0 0 if defined $exon_scores
1900 0 1 unless ($args{'dataset'})
1910 0 1 unless ($args{'extend'})
1913 0 1 unless $args{'db'} or $self->{'data'}->open_meta_database
1916 1 0 unless defined $args{'coordinate'}
1922 0 1 if $params[1] < 1
1924 0 1 defined $args{'strand'} ? :
1935 0 1 if ($args{'avoid'})
1940 0 1 if ($args{'absolute'}) { }
1942 0 0 wantarray ? :
1958 0 4 unless ($args{'dataset'})
1967 0 4 unless $args{'db'} or $self->{'data'}->open_meta_database
1971 0 0 if ($self->feature_type eq "named" and $args{'subfeature'})
1983 0 4 defined $args{'strand'} ? :
1984 0 4 if ($args{'extend'})
1987 0 0 if $params[1] < 1
1999 0 4 if ($args{'avoid'})
2004 0 4 if ($args{'absolute'}) { }
2006 0 0 wantarray ? :
2010 4 0 unless defined $args{'coordinate'}
2021 0 0 unless (@$subfeatures)
2025 0 0 if exists $args->{'exon'}
2043 0 0 defined $args->{'strand'} ? :
2070 0 0 if ($args->{'extend'})
2102 0 0 if ($args->{'absolute'}) { }
2104 0 0 wantarray ? :
2119 0 9 defined $args->{'strand'} ? :
2120 6 3 if ($args->{'position'} == 5) { }
1 2 elsif ($args->{'position'} == 3) { }
2 0 elsif ($args->{'position'} == 4) { }
0 0 elsif ($args->{'position'} == 9) { }
2121 1 5 if ($strand >= 0) { }
2129 1 0 if ($strand >= 0) { }
2139 1 1 if (exists $args->{'practical_start'}) { }
2161 0 0 if (ref $args->{'avoid'} eq 'ARRAY') { }
0 0 elsif ($args->{'avoid'} eq '1') { }
0 0 elsif ($args->{'avoid'} =~ /w+/i) { }
2166 0 0 if (defined $args->{'type'}) { }
2190 0 0 if (@overlap_features)
2199 0 0 if $feat->primary_id eq $primary
2206 0 0 if ($position >= $start and $position <= $stop)
2221 0 5 if ($strand >= 0) { }
5 0 elsif ($strand < 0) { }
2231 5 0 wantarray ? :
2239 0 0 if ($method eq 'ncount') { }
2242 0 0 unless $p >= $start and $p <= $end
2244 0 0 if (exists $namecheck->{$n}) { }
2260 0 0 unless $p >= $start and $p <= $end
2275 0 0 unless ($args{'db'})
2278 0 0 unless ($args{'data'} and ref $args{'data'} eq "HASH")
2281 0 0 unless ($args{'callback'})
2287 0 0 if ($self->feature_type eq 'named' and $args{'subfeature'}) { }
2292 0 0 if (@$subfeatures) { }
2319 0 0 unless defined $tid
2348 0 0 unless $args{'bed'} =~ /^\d+$/
2349 0 0 unless $args{'bed'} >= 3
2357 0 0 if ($chr eq "." or not CORE::length $chr or $start eq "." or not CORE::length $start)
2361 0 0 if ($start > $stop)
2372 0 0 if ($args{'bed'} >= 4)
2376 0 0 if ($args{'bed'} >= 5)
2377 0 0 exists $args{'score'} ? :
2378 0 0 unless defined $score
2381 0 0 if ($args{'bed'} >= 6)
2383 0 0 if (exists $args{'strand'} and defined $args{'strand'}) { }
2389 0 0 $s == -1 ? :
2408 0 0 if ($chr eq "." or not CORE::length $chr or $start eq "." or not CORE::length $start)
2412 0 0 if ($start > $stop)
2420 0 0 if (exists $args{'strand'} and defined $args{'strand'}) { }
2426 0 0 $strand == 1 ? :
0 0 $strand == -1 ? :
2431 0 0 if (defined $type and $type =~ /:/)
2434 0 0 unless ($source)
2437 0 0 unless ($primary_tag)
2438 0 0 $args{'primary_tag'} || defined $type ? :
2442 0 0 exists $args{'score'} ? :
2443 0 0 unless defined $score
2451 0 0 if (exists $args{'attributes'} and ref $args{'attributes'} eq "ARRAY")