Branch Coverage

Bio/SeqIO/embl.pm
Criterion Covered Total %
branch 267 434 61.5


line true false branch
162 31 0 if (not defined $self->sequence_factory)
190 1 24 unless (defined $line)
194 1 23 if ($line =~ /^\s+$/)
196 1 0 if $line =~ /^\S/
200 0 1 unless $line
204 0 24 unless $line =~ /^ID\s+\S+/
209 10 14 if ($line =~ tr/;// == 6) { }
217 7 3 if ($line =~ /^ID (\S+);\s+SV (\d+); (\w+); ([^;]+); (\w{3}); (\w{3}); (\d+) BP./)
220 7 3 if (defined $sv)
225 0 10 if (defined $topology and $topology eq 'circular')
229 7 3 if (defined $mol)
230 6 1 if ($mol =~ /DNA/) { }
1 0 elsif ($mol =~ /RNA/) { }
0 0 elsif ($mol =~ /AA/) { }
241 12 2 if ($line =~ /^ID\s+(\S+)[^;]*;\s+(\S+)[^;]*;\s+(\S+)[^;]*;/)
245 12 2 if ($mol)
246 0 12 if ($mol =~ /circular/)
250 12 0 if (defined $mol)
251 10 2 if ($mol =~ /DNA/) { }
2 0 elsif ($mol =~ /RNA/) { }
0 0 elsif ($mol =~ /AA/) { }
262 5 19 unless (defined $name and length $name)
274 24 475 if (/^(F[HT]|SQ)/)
275 2 22 if $1 eq 'SQ' or $1 eq 'FT'
279 22 453 if (/^DE\s+(\S.*\S)/)
280 2 20 $desc ? :
284 24 451 if (/^AC\s+(.*)?/ or /^PA\s+(.*)?/)
287 23 1 unless defined $params{'-accession_number'}
292 6 469 if (/^SV\s+\S+\.(\d+);?/)
300 26 449 if (/^DT\s+(.+)$/)
304 24 2 if ($version)
305 11 13 if ($version =~ /\(Rel\. (\d+), Created\)/ms) { }
11 2 elsif ($version =~ /\(Rel\. (\d+), Last updated, Version (\d+)\)/ms) { }
329 29 446 if (/^KW (.*)\S*$/) { }
21 425 elsif (/^O[SC]/) { }
3 422 elsif (/^OX/) { }
99 323 elsif (/^R/) { }
5 318 elsif (/^DR/) { }
15 303 elsif (/^CC\s+(.*)/) { }
343 3 0 if (/NCBI_TaxID=(\d+)/)
374 242 15 if (/^CC\s+(.*)/) { }
392 22 24 if /^FT\s{3}\w/
393 2 22 if /^SQ /
394 0 22 if /^CO /
398 22 2 if (defined $buffer and $buffer =~ /^FT /)
410 12 6 if ($params{'-species'} and $feat->primary_tag eq 'source' and $feat->has_tag('db_xref') and not $params{'-species'}->ncbi_taxid)
414 12 0 if (index($tagval, 'taxon:') == 0)
424 22 234 unless ($buffer =~ /^FT/)
430 2 19 if ($params{'-species'} and defined $ncbi_taxid and not $params{'-species'}->ncbi_taxid)
440 4 20 if ($buffer =~ /^CO/)
445 4 0 unless ($buffer and $buffer =~ /^CO/)
451 20 4 unless ($buffer =~ m[^//])
452 1 19 unless ($buffer =~ /^SQ/)
454 0 0 if /^SQ/
459 18 2906 if m[^//]
500 0 11 if ($self->_id_generation_func) { }
508 5 6 if (not defined $name or $name eq 'unknown')
513 0 11 if $name =~ /\s/
522 2 9 if ($seq->can('division') and defined $seq->division and $self->_is_valid_division($seq->division)) { }
531 0 11 if ($seq->can('molecule') and defined $seq->molecule and $self->_is_valid_molecule_type($seq->molecule)) { }
6 7 elsif ($seq->can('primary_seq') and defined $seq->primary_seq->alphabet) { }
540 6 0 if ($alphabet eq 'dna') { }
0 0 elsif ($alphabet eq 'rna') { }
0 0 elsif ($alphabet eq 'protein') { }
551 0 11 if ($seq->is_circular)
641 0 13 unless defined $seq
642 4 9 unless (ref $seq and $seq->isa('Bio::SeqI'))
643 0 4 if $self->verbose >= 0
645 2 2 unless (ref $seq and $seq->isa('Bio::PrimarySeqI'))
658 0 11 if (my $func = $self->_ac_generation_func) { }
4 7 elsif ($seq->isa('Bio::Seq::RichSeqI') and defined $seq->accession_number) { }
7 0 elsif ($seq->can('accession_number')) { }
668 11 0 if (defined $acc)
669 0 11 unless $self->_print("AC $acc;\n", "XX\n")
676 4 7 if ($seq->can('get_dates'))
684 0 0 unless ($cr and $ur and $ur)
689 0 0 if (not $date_flag) { }
690 0 0 if $ct == 1
693 0 0 if $ct == 2
703 0 4 if ($switch == 1)
704 0 0 unless $self->_print("XX\n")
709 0 11 unless $self->_write_line_EMBL_regex('DE ', 'DE ', $seq->desc, '\\s+|$', 80)
710 0 11 unless $self->_print("XX\n")
715 0 11 if (my $func = $self->_kw_generation_func) { }
4 7 elsif ($seq->can('keywords')) { }
720 4 7 if (defined $kw)
721 0 4 unless $self->_write_line_EMBL_regex('KW ', 'KW ', $kw, '\\s+|$', 80)
722 0 4 unless $self->_print("XX\n")
728 6 5 if ($seq->can('species') and my $spec = $seq->species)
735 0 6 if ($spec->common_name)
738 0 6 unless $self->_print("OS $OS\n")
740 0 6 unless $self->_write_line_EMBL_regex('OC ', 'OC ', $OC, '; |$', 80)
741 0 6 if ($spec->organelle)
742 0 0 unless $self->_write_line_EMBL_regex('OG ', 'OG ', $spec->organelle, '; |$', 80)
745 2 4 if ($ncbi_taxid)
746 0 2 unless $self->_print("OX NCBI_TaxID=$ncbi_taxid\n")
748 0 6 unless $self->_print("XX\n")
752 9 2 if ($seq->can('annotation') and defined $seq->annotation)
754 0 6 unless $self->_print("RN [$t]\n")
758 0 6 if ($ref->comment)
759 0 0 unless $self->_write_line_EMBL_regex('RC ', 'RC ', $ref->comment, '\\s+|$', 80)
763 6 0 if ($start and $end) { }
0 0 elsif ($start or $end) { }
764 0 6 unless $self->_print("RP $start-$end\n")
770 0 6 if (my $med = $ref->medline)
771 0 0 unless $self->_print("RX MEDLINE; $med.\n")
773 0 6 if (my $pm = $ref->pubmed)
774 0 0 unless $self->_print("RX PUBMED; $pm.\n")
779 0 6 unless $self->_write_line_EMBL_regex('RA ', 'RA ', $authors . ';', '\\s+|$', 80)
788 0 6 unless $self->_write_line_EMBL_regex('RT ', 'RT ', $ref_title, '\\s+|$', 80)
789 0 6 unless $self->_write_line_EMBL_regex('RL ', 'RL ', $ref->location, '\\s+|$', 80)
790 0 6 unless $self->_print("XX\n")
795 2 7 if (my(@db_xref) = $seq->annotation->get_Annotations('dblink'))
801 0 43 $opt ? :
802 0 43 unless $self->_write_line_EMBL_regex('DR ', 'DR ', $line, '\\s+|$', 80)
804 0 2 unless $self->_print("XX\n")
809 0 4 unless $self->_write_line_EMBL_regex('CC ', 'CC ', $comment->text, '\\s+|$', 80)
810 0 4 unless $self->_print("XX\n")
817 0 11 unless $self->_print("FH Key Location/Qualifiers\n")
818 0 11 unless $self->_print("FH\n")
820 9 2 $seq->can('top_SeqFeatures') ? :
821 6 5 if ($feats[0])
822 0 6 if (defined $self->_post_sort) { }
836 0 0 unless $self->_print_EMBL_FTHelper($fth)
845 0 38 if ($fth->key eq 'CONTIG')
848 0 38 unless $self->_print_EMBL_FTHelper($fth)
854 0 11 if ($self->_show_dna == 0)
855 0 0 unless $self->_print("//\n")
858 0 11 unless $self->_print("XX\n")
863 9 2 if ($seq->can('annotation') and defined $seq->annotation)
865 0 0 if ($ctg->value)
866 0 0 unless $self->_write_line_EMBL_regex('CO ', 'CO ', $ctg->value, '[,]|$', 80)
872 8 3 if (length $str)
883 0 8 if ($olen < 0)
887 0 8 unless $self->_print("SQ Sequence $len BP; $alen A; $clen C; $glen G; $tlen T; $olen other;\n")
903 0 162 unless $self->_print(sprintf(" $blocks%9d\n", $i + $nuc))
907 8 0 if (my $last = substr($str, $i))
912 0 8 unless $self->_print(sprintf(" $blocks%9d\n", $length))
917 0 11 unless $self->_print("//\n")
919 11 0 if $self->_flush_on_write and defined $self->_fh
938 0 38 unless (ref $fth and $fth->isa('Bio::SeqIO::FTHelper'))
946 0 38 if ($fth->key eq 'CONTIG')
947 0 0 unless $self->_print("XX\n")
948 0 0 unless $self->_write_line_EMBL_regex('CO ', 'CO ', $fth->loc, '\\,|$', 80)
953 0 38 unless $self->_write_line_EMBL_regex(sprintf('FT %-15s ', $fth->key), 'FT ', $fth->loc, '\\,|$', 80)
957 0 108 unless (defined $fth->field->{$tag})
962 0 139 if ($value eq '_no_value') { }
139 0 elsif (not $Bio::SeqIO::embl::FTQUAL_NO_QUOTE{$tag} or length "/$tag=$value" >= 60) { }
963 0 0 unless $self->_write_line_EMBL_regex('FT ', 'FT ', "/$tag", '.|$', 80)
972 80 59 $value =~ /\s+/ ? :
973 0 139 unless $self->_write_line_EMBL_regex('FT ', 'FT ', qq[/$tag="$value"], $pat, 80)
977 0 0 unless $self->_write_line_EMBL_regex('FT ', 'FT ', "/$tag=$value", '.|$', 80)
1002 0 4 unless ($$buffer =~ /^CO/)
1007 3 353 unless /^C/
1008 353 0 if (/^CO\s+(.*)/)
1036 0 99 unless ($$buffer =~ /^RN/)
1049 99 628 unless /^R/
1050 40 588 if (/^RP (\d+)-(\d+)/)
1051 55 573 if (/^RX MEDLINE;\s+(\d+)/)
1052 10 618 if (/^RX PUBMED;\s+(\d+)/)
1053 193 435 if (/^RA (.*)/)
1056 164 271 if (/^RT (.*)/)
1059 156 115 if (/^RL (.*)/)
1062 3 112 if (/^RC (.*)/)
1105 21 71 if (/^OS\s+(.+)/) { }
50 21 elsif (s/^OC\s+(.+)$//) { }
0 21 elsif (/^OG\s+(.*)/) { }
1106 0 21 $sci_name ? :
1122 0 21 unless $sci_name
1132 21 0 if $class[-2]
1133 21 0 if ($sci_name =~ /^($possible_genus)/) { }
1141 21 0 if ($genus)
1142 0 21 if $genus =~ /^(Unknown|None)$/i
1147 0 21 if ($species =~ /subsp\.|var\./)
1155 21 0 unless ($class[-1] eq 'Viruses')
1157 11 10 if $common
1161 21 0 unless ($class[-1] eq $sci_name)
1169 0 21 unless $sci_name
1184 21 0 unless ($class[-1] eq 'Viruses')
1185 21 0 if $genus
1186 11 10 if $species
1187 0 21 if $sub_species
1188 11 10 if $common
1190 0 21 if $org
1211 25 5 if (/^DR ([^\s;]+);\s*([^\s;]+);?\s*([^\s;]+)?\.$/) { }
1245 1 3 if (/^OX (\S+)=(\d+);$/) { }
1274 0 0 if (defined $value)
1301 256 0 if ($$buffer =~ /^FT\s{3}(\S+)\s+(\S+)/) { }
0 0 elsif ($$buffer =~ /^CO\s+(\S+)/) { }
1306 2016 22 if (/^FT(\s+)(.+?)\s*$/) { }
1309 1782 234 if (length $1 > 4) { }
1311 1523 259 if (@qual) { }
254 5 elsif (substr($2, 0, 1) eq '/') { }
1336 0 0 if (/^CO\s+(\S+)\s*$/) { }
1365 0 1091 unless (($qualifier, $value) = $data =~ m[^/([^=]+)(?:=\s*(.*))?])
1366 0 0 if (defined $last_unquoted_qualifier) { }
1371 0 0 if $qualifier ne 'translation'
1383 0 1091 unless defined $qualifier
1386 1091 0 if (defined $value) { }
1388 971 120 if (substr($value, 0, 1) eq '"') { }
1395 0 686 unless (defined $next)
1405 569 117 if ($qualifier eq 'translation') { }
1445 0 0 unless $length
1452 0 0 unless $self->_print("$pre1$sub\n")
1456 0 0 unless $self->_print("$pre2$sub\n")
1483 0 263 unless $length
1490 401 0 if ($line =~ /^(.{1,$subl})($pat)(.*)/)
1492 8 393 if $pre1 eq 'RA '
1499 0 401 if $l eq ''
1511 256 7 if $s
1513 0 145 unless $self->_print("$pre2$s\n")
1532 0 6 if (@_)
1553 31 11 if (@_)
1574 0 11 if (@_)
1595 0 11 if (@_)
1616 0 0 if (@_)
1637 0 11 if (@_)