Branch Coverage

blib/lib/Bio/ToolBox/parser/gff.pm
Criterion Covered Total %
branch 149 306 48.6


line true false branch
319 8 3 if (@_)
320 0 8 if (scalar @_ == 1) { }
321 0 0 unless $self->open_file($_[0])
325 4 4 if (exists $options{'simplify'})
328 4 4 if (exists $options{'do_gene'})
331 2 6 if (exists $options{'do_exon'})
334 4 4 if (exists $options{'do_cds'})
337 0 8 if (exists $options{'do_utr'})
340 0 8 if (exists $options{'do_codon'})
343 0 8 if (exists $options{'version'})
346 8 0 if (exists $options{'file'} or $options{'table'})
348 0 8 unless $self->open_file($options{'file'})
351 8 0 if (exists $options{'class'})
353 8 0 if (eval "require $class; 1") { }
369 7 586 if (@_)
377 6 182 if (@_)
385 5 267 if (@_)
393 0 0 if (@_)
401 0 34 if (@_)
419 7 78 if (defined $_[0])
427 11 13 if (@_)
429 7 4 if ($v eq '3') { }
4 0 elsif ($v eq '2.5' or $v eq '2.2') { }
0 0 elsif ($v eq '2' or $v eq '1') { }
452 0 11 unless ($filename)
459 0 11 unless ($typelist =~ /\w+/)
466 0 11 unless my $fh = "Bio::ToolBox::Data::file"->open_to_read_fh($filename)
471 11 0 if ($first =~ /^##gff.version\s+([\d\.]+)\s*$/i) { }
481 0 0 if ($filename =~ /\.gtf.*$/i) { }
0 0 elsif ($filename =~ /\.gff3.*$/i) { }
506 0 587 unless ($self->fh)
509 0 587 if $self->{'eof'}
512 11 576 unless (defined $self->{'convertor_sub'})
523 25 745 if ($firstchar eq '#') { }
0 745 elsif ($firstchar eq '>') { }
524 0 25 if ($line =~ /^###$/) { }
0 25 elsif ($line =~ /^##sequence.region/i) { }
533 0 0 if (defined $seq_id and $start =~ /^\d+$/ and $stop =~ /^\d+$/) { }
559 0 745 unless scalar @fields == 9
563 265 480 if ($type eq 'cds') { }
178 302 elsif ($type eq 'exon') { }
0 302 elsif ($type =~ /utr|untranslated/) { }
32 270 elsif ($type =~ /codon/) { }
165 105 elsif ($type =~ /gene$/) { }
36 69 elsif ($type =~ /transcript|rna/) { }
7 62 elsif ($type =~ /chromosome|contig|scaffold/) { }
564 199 66 if ($self->do_cds) { }
571 178 0 if ($self->do_exon) { }
578 0 0 if ($self->do_utr) { }
585 0 32 if ($self->do_codon) { }
592 165 0 if ($self->do_gene) { }
610 2 60 unless $self->simplify
622 0 70 unless ($self->fh)
625 0 70 unless ($self->{'eof'})
626 0 0 unless $self->parse_file
633 0 4 unless ($self->{'eof'})
637 4 0 wantarray ? :
645 0 7 unless ($self->fh)
648 0 7 if $self->{'eof'}
657 2 0 $self->version =~ /2\../ ? :
5 2 $self->version eq '3' ? :
671 404 172 if ($id)
673 0 404 if (exists $self->{'loaded'}{$id}) { }
677 0 0 if ($feature->primary_tag =~ /gene|rna|transcript/)
682 0 0 if (ref $self->{'loaded'}{$id} eq 'ARRAY') { }
700 411 165 if ($feature->has_tag('Parent')) { }
704 411 0 if (exists $self->{'loaded'}{$parent_id}) { }
713 312 99 if ($self->{'gtf'})
714 0 312 if ($feature->start < $parent->start)
717 1 311 if ($feature->end > $parent->end)
721 278 34 if ($parent->has_tag("Parent"))
726 0 278 if ($feature->start < $grandparent->start)
729 0 278 if ($feature->end > $grandparent->end)
750 0 7 if (scalar @{$self->{'orphans'};})
753 0 0 if (scalar @{$self->{'orphans'};})
760 0 7 if (keys %{$$self{"duplicate_ids"};})
781 12 0 if ($fields->[8] =~ /gene_name "([^"]+)";?/) { }
789 2 10 unless ($self->simplify)
790 0 2 if ($fields->[8] =~ /gene_biotype "([^"]+)";?/) { }
0 2 elsif ($fields->[8] =~ /gene_type "([^"]+)";?/) { }
796 0 2 if ($fields->[8] =~ /gene_source "([^"]+)";?/)
816 0 0 if ($fields->[8] =~ /transcript_name "([^"]+)";?/) { }
824 0 0 unless ($self->simplify)
825 0 0 if ($fields->[8] =~ /transcript_biotype "([^"]+)";?/) { }
0 0 elsif ($fields->[8] =~ /transcript_type "([^"]+)";?/) { }
831 0 0 if ($fields->[8] =~ /transcript_source "([^"]+)";?/)
843 5 32 unless (exists $self->{'gene2seqf'})
844 0 5 unless $self->{'eof'}
848 0 107 if (exists $self->{'gene2seqf'}{$name}) { }
859 0 37 if (scalar @_ == 0) { }
4 33 elsif (scalar @_ == 1) { }
875 0 37 unless ($name)
881 37 0 if (exists $self->{'gene2seqf'}{lc $name})
889 33 4 if ($id)
891 33 0 if ($g->primary_id eq $id)
897 0 0 if ($chrom and $start and $end)
899 0 0 if ($g->strand == $strand and not $g->start > $end || $g->end < $start)
913 4 0 if (scalar @$genes == 1) { }
0 0 elsif (scalar @$genes > 1) { }
933 0 0 unless ($string)
940 0 0 unless (defined $self->{'convertor_sub'})
951 7 4 if ($self->{'gff3'}) { }
4 0 elsif ($self->{'gtf'}) { }
955 2 2 if ($self->simplify) { }
962 0 4 unless ($self->typelist =~ /transcript|rna/i)
964 0 0 unless ($self->do_exon or $self->do_cds)
968 4 0 if ($self->do_gene and not $self->typelist =~ /gene/i)
990 266 1116 if ($tag eq 'Name') { }
167 949 elsif ($tag eq 'ID') { }
99 850 elsif ($tag eq 'Parent') { }
0 850 elsif (lc $tag eq 'exon_id') { }
2 848 elsif (not $self->{'simplify'}) { }
998 99 0 unless (not $self->do_gene and $feature->primary_tag =~ /rna|transcript/i)
1027 312 0 if ($group =~ /gene_id "([^"]+)";?/i)
1030 312 0 if ($group =~ /transcript_id "([^"]+)";?/i)
1033 0 312 unless ($gene_id or $transcript_id)
1039 278 34 if ($fields->[2] =~ /cds|exon|utr|codon|untranslated/i) { }
34 0 elsif ($fields->[2] =~ /rna|transcript/i) { }
0 0 elsif ($fields->[2] eq 'gene') { }
1043 0 278 if ($fields->[2] eq "exon" and $group =~ /exon_id "([^"]+)";?/i)
1048 0 278 if ($self->do_gene and not exists $self->{'loaded'}{$gene_id})
1055 0 278 unless (exists $self->{'loaded'}{$transcript_id})
1058 0 0 if ($self->do_gene) { }
1075 34 0 if ($group =~ /transcript_name "([^"]+)";?/i)
1080 34 0 if ($self->do_gene)
1082 10 24 unless (exists $self->{'loaded'}{$gene_id})
1095 0 0 if ($group =~ /gene_name "([^"]+)";?/i)
1121 0 2 if ($fields->[2] =~ /cds|exon|utr|codon|untranslated/i) { }
2 0 elsif ($fields->[2] =~ /transcript|rna/i) { }
0 0 elsif ($fields->[2] eq 'gene') { }
1125 0 0 if ($fields->[2] eq "exon" and exists $attributes{'exon_id'})
1130 0 0 if ($self->do_gene)
1132 0 0 if ($gene_id and not exists $self->{'loaded'}{$gene_id})
1141 0 0 if ($transcript_id and not exists $self->{'loaded'}{$transcript_id})
1144 0 0 if ($self->do_gene) { }
1161 2 0 if (exists $attributes{'transcript_name'})
1167 2 0 if ($self->do_gene)
1169 2 0 if ($gene_id and not exists $self->{'loaded'}{$gene_id})
1184 0 0 if (exists $attributes{'gene_name'})
1209 0 0 unless $tag and $value
1230 0 580 if ($fields->[5] ne ".")
1233 199 381 if ($fields->[7] ne ".")
1262 0 0 unless scalar @{$self->{'orphans'};}
1272 0 0 if (exists $self->{'loaded'}{$parent})
1280 0 0 if $success
1296 0 0 wantarray ? :
1306 0 0 wantarray ? :
1312 0 0 unless (scalar keys %{$$self{"seq_ids"};})
1316 0 0 wantarray ? :
1322 0 0 unless (scalar keys %{$$self{"seq_ids"};})
1330 0 0 unless $self->{'eof'}
1333 0 0 unless (exists $self->{'seq_ids'}{$s})
1336 0 0 if $_->end > $self->{'seq_ids'}{$s}