Branch Coverage

blib/lib/Bio/ToolBox/parser/ucsc.pm
Criterion Covered Total %
branch 212 382 55.5


line true false branch
393 3 2 if (@_)
394 0 3 if (scalar @_ == 1) { }
401 3 0 if (exists $options{'file'} or $options{'table'})
405 1 2 if (exists $options{'do_gene'})
408 3 0 if (exists $options{'do_exon'})
411 1 2 if (exists $options{'do_cds'})
414 1 2 if (exists $options{'do_utr'})
417 0 3 if (exists $options{'do_codon'})
420 0 3 if (exists $options{'do_name'})
423 0 3 if (exists $options{'share'})
426 0 3 if (exists $options{'source'})
429 0 3 if (exists $options{'refseqsum'}) { }
0 3 elsif (exists $options{'summary'}) { }
435 0 3 if (exists $options{'refseqstat'}) { }
0 3 elsif (exists $options{'status'}) { }
441 0 3 if (exists $options{'kgxref'})
444 0 3 if (exists $options{'ensembltogenename'}) { }
0 3 elsif (exists $options{'ensname'}) { }
450 0 3 if (exists $options{'ensemblsource'}) { }
1 2 elsif (exists $options{'enssrc'}) { }
456 2 1 if (exists $options{'class'})
472 5 118 if (@_)
485 3 92 if (@_)
493 4 89 if (@_)
501 1 54 if (@_)
509 1 52 if (@_)
517 0 54 if (@_)
525 0 231 if (@_)
533 0 394 if (@_)
541 7 227 if (@_)
552 0 7 unless ($filename)
558 0 7 unless my $fh = 'Bio::ToolBox::Data::file'->open_to_read_fh($filename)
564 7 7 if $line =~ /^#/
565 0 7 unless $line =~ /\w+/
570 0 0 unless ($ncol == 16 or $ncol == 15 or $ncol == 12 or $ncol == 11 or $ncol == 10)
574 0 7 if ($ncol == 10)
584 5 2 if ($filename =~ /ensgene/i and $self->source eq 'UCSC') { }
0 2 elsif ($filename =~ /xenorefgene/i and $self->source eq 'UCSC') { }
0 2 elsif ($filename =~ /refgene/i and $self->source eq 'UCSC') { }
0 2 elsif ($filename =~ /refseq/i and $self->source eq 'UCSC') { }
0 4 elsif ($filename =~ /knowngene/i and $self->source eq 'UCSC') { }
604 2 5 if ($self->fh)
624 0 5 unless ($file)
630 2 3 if ($type =~ /ensembltogene|ensname/i) { }
3 0 elsif ($type =~ /ensemblsource|enssrc/i) { }
0 0 elsif ($type =~ /refseqstat|status/i) { }
0 0 elsif ($type =~ /refseqsum|summary/i) { }
0 0 elsif ($type =~ /kgxref/i) { }
651 0 5 unless ($fh)
658 5 0 if ($type =~ /ensembl/) { }
660 2 3 $type eq 'ensembltogene' ? :
665 0 85 if $line =~ /^#/
667 0 85 if (scalar @line_data != 2)
712 0 0 if $line =~ /^#/
720 0 0 if (exists $self->{$type}{$id})
739 0 0 if $self->{'counts'}{$k} > 0
741 0 3 if (@items) { }
746 2 1 $self->do_gene ? :
754 0 92 unless ($self->fh)
760 27 87 if ($line =~ /^#/ or not $line =~ /\w+/)
766 0 87 unless ($builder)
774 70 17 if ($self->do_gene) { }
792 0 25 unless ($self->{'eof'})
800 0 2 unless ($self->{'eof'})
804 2 0 wantarray ? :
811 2 3 if (@_)
812 0 2 unless $self->open_file(shift())
814 0 5 unless ($self->fh)
818 0 5 if $self->{'eof'}
826 85 0 unless ($gene)
833 5 80 unless (exists $self->{'seq_ids'}{$s})
836 25 60 if $feature->end > $self->{'seq_ids'}{$s}
843 0 0 unless $Bio::ToolBox::parser::ucsc::a->[0] cmp $Bio::ToolBox::parser::ucsc::b->[0]
856 0 87 if (scalar @_ == 0) { }
87 0 elsif (scalar @_ == 1) { }
872 0 87 unless ($name)
878 2 85 if (exists $self->{'gene2seqf'}{lc $name})
886 0 2 if ($id)
888 0 0 if ($g->primary_id eq $id)
894 0 0 if ($chrom and $start and $end)
896 0 0 if ($g->strand == $strand and not $g->start > $end || $g->end < $start)
910 2 0 if (scalar @$genes == 1) { }
0 0 elsif (scalar @$genes > 1) { }
927 2 0 wantarray ? :
932 0 0 unless $string
934 0 0 unless $builder
935 0 0 if ($self->do_gene) { }
946 0 0 wantarray ? :
969 3 170 if ($ucsc->{'sfclass'} ne $SFCLASS)
971 0 3 unless eval "require $SFCLASS"
981 87 86 if (scalar @linedata == 16) { }
0 86 elsif (scalar @linedata == 15) { }
0 86 elsif (scalar @linedata == 12) { }
0 86 elsif (scalar @linedata == 11) { }
86 0 elsif (scalar @linedata == 10) { }
1020 0 87 if ($linedata[1] =~ /^N[MR]_\d+/)
1062 0 0 if ($linedata[0] =~ /^N[MR]_\d+/)
1138 0 0 if ($linedata[1] =~ /^N[MR]_\d+/)
1173 0 86 if ($linedata[0] =~ /^N[MR]_\d+/)
1185 0 173 unless $self{'strand'} =~ /^[\+\-]$/
1186 0 173 unless $self{'txStart'} =~ /^\d+$/
1187 0 173 unless $self{'txEnd'} =~ /^\d+$/
1188 0 173 unless $self{'cdsStart'} =~ /^\d+$/
1189 0 173 unless $self{'cdsEnd'} =~ /^\d+$/
1190 0 173 unless $self{'exonCount'} =~ /^\d+$/
1191 0 173 unless $self{'exonStarts'} =~ /^[\d,]+$/
1192 0 173 unless $self{'exonEnds'} =~ /^[\d,]+$/
1193 0 173 if (@errors)
1199 155 18 $self{'strand'} eq '+' ? :
1206 63 110 if ($self{'cdsStart'} - 1 == $self{'cdsEnd'}) { }
1211 21 42 if ($type) { }
0 42 elsif ($self{'name2'} =~ /^mir/i) { }
0 42 elsif ($self{'name2'} =~ /^snr/i) { }
0 42 elsif ($self{'name2'} =~ /^sno/i) { }
1237 32 78 defined $type ? :
1300 0 243 exists $self->{'refseq'} ? :
1305 243 0 exists $self->{'note'} ? :
1310 173 0 exists $self->{'status'} ? :
1315 173 0 exists $self->{'completeness'} ? :
1332 48 22 if ($gene) { }
1334 0 48 if ($self->txStart < $gene->start)
1338 4 44 if ($self->txEnd > $gene->end)
1359 0 22 if (exists $$id2count{lc $id}) { }
1374 12 10 if ($self->name2 ne $self->gene_name)
1402 0 173 if (exists $$id2count{lc $id}) { }
1416 173 0 if (exists $$ensembldata{$self->name}) { }
1418 26 147 if ($t and $t =~ /protein.coding/i) { }
15 132 elsif ($t and $t =~ /rna|transcript/i) { }
12 120 elsif ($t) { }
1452 36 137 if ($self->gene_name ne $self->name2)
1460 0 173 if (defined $self->completeness)
1463 0 173 if (defined $self->status)
1466 53 120 if ($biotype)
1471 122 51 if ($ucsc->do_exon)
1476 110 63 if ($self->cdsStart - 1 != $self->cdsEnd)
1478 10 100 if ($ucsc->do_utr)
1482 0 110 if ($ucsc->do_codon)
1486 10 100 if ($ucsc->do_cds)
1502 0 243 if (defined $self->note)
1507 0 243 if (defined $self->refseq)
1512 0 243 if (exists $self->{'spid'} and defined $self->{'spid'})
1517 0 243 if (exists $self->{'spdid'} and defined $self->{'spdid'})
1522 0 243 if (exists $self->{'protacc'} and defined $self->{'protacc'})
1533 0 0 if ($_ eq $value)
1540 0 0 if $check
1552 277 318 if ($ucsc->share and $gene)
1555 156 121 if ($exon)
1566 427 12 if ($transcript->strand == 1) { }
1587 0 439 if ($ucsc->do_name)
1608 76 0 if ($transcript->strand == 1) { }
1626 0 76 if ($self->exonStarts->[$i] < $self->cdsStart and $self->exonEnds->[$i] > $self->cdsEnd) { }
3 73 elsif ($self->exonStarts->[$i] < $self->cdsStart and $self->exonEnds->[$i] < $self->cdsStart) { }
9 64 elsif ($self->exonStarts->[$i] < $self->cdsStart and $self->exonEnds->[$i] >= $self->cdsStart) { }
50 14 elsif ($self->exonStarts->[$i] >= $self->cdsStart and $self->exonEnds->[$i] <= $self->cdsEnd) { }
7 7 elsif ($self->exonStarts->[$i] <= $self->cdsEnd and $self->exonEnds->[$i] > $self->cdsEnd) { }
7 0 elsif ($self->exonStarts->[$i] > $self->cdsEnd and $self->exonEnds->[$i] > $self->cdsEnd) { }
1638 0 0 $transcript->strand == 1 ? :
1643 0 0 $transcript->strand == 1 ? :
1655 3 0 $transcript->strand == 1 ? :
1668 9 0 $transcript->strand == 1 ? :
1691 7 0 $transcript->strand == 1 ? :
1704 7 0 $transcript->strand == 1 ? :
1722 26 0 if ($ucsc->share and $gene)
1727 19 7 unless ($utr)
1738 0 19 if $ucsc->do_name
1746 0 26 if ($start2)
1750 0 0 if ($ucsc->share)
1755 0 0 unless ($utr2)
1766 0 0 if $ucsc->do_name
1796 76 0 if ($transcript->strand == 1) { }
1814 0 76 if ($self->exonStarts->[$j] < $self->cdsStart and $self->exonEnds->[$j] > $self->cdsEnd) { }
3 73 elsif ($self->exonStarts->[$j] < $self->cdsStart and $self->exonEnds->[$j] < $self->cdsStart) { }
9 64 elsif ($self->exonStarts->[$j] < $self->cdsStart and $self->exonEnds->[$j] >= $self->cdsStart) { }
50 14 elsif ($self->exonStarts->[$j] >= $self->cdsStart and $self->exonEnds->[$j] <= $self->cdsEnd) { }
7 7 elsif ($self->exonStarts->[$j] <= $self->cdsEnd and $self->exonEnds->[$j] > $self->cdsEnd) { }
7 0 elsif ($self->exonStarts->[$j] > $self->cdsEnd and $self->exonEnds->[$j] > $self->cdsEnd) { }
1912 46 20 if $phase > 2
1927 0 0 if ($transcript->strand == 1) { }
1931 0 0 if ($ucsc->share and $gene)
1939 0 0 unless ($start_codon)
1950 0 0 if $ucsc->do_name
1955 0 0 unless ($stop_codon)
1966 0 0 if $ucsc->do_name
1975 0 0 if ($ucsc->share and $gene)
1983 0 0 unless ($stop_codon)
1994 0 0 if $ucsc->do_name
1999 0 0 unless ($start_codon)
2011 0 0 if $ucsc->do_name
2025 48 22 if (exists $self->ucsc->{'gene2seqf'}{lc $self->gene_name})
2037 48 0 if ($g->strand == $self->strand and not $g->start > $self->txEnd || $g->end < $self->txStart)
2061 163 5189 if ($subfeature->primary_tag eq $type and $subfeature->start == $start and $subfeature->end == $stop)