Branch Coverage

blib/lib/OBO/Parser/OBOParser.pm
Criterion Covered Total %
branch 268 432 62.0


line true false branch
54 9 0 if (defined $_[0]) { }
60 0 9 unless open OBO_FILE, $self->{'OBO_FILE'}
71 9 0 if (defined $chunks[0] and $chunks[0] =~ /^format-version:\s*(.*)/) { }
81 9 0 if ($chunks[0] =~ /(^format-version:\s*(.*)\n?)/m)
90 1 8 if ($chunks[0] =~ /(^data-version:\s*(.*)\n?)/m)
99 1 8 if ($chunks[0] =~ /(^ontology:\s*(.*)\n?)/m)
108 9 0 if ($chunks[0] =~ /(^date:\s*(.*)\n?)/m)
117 7 2 if ($chunks[0] =~ /(^saved-by:\s*(.*)\n?)/m)
126 8 1 if ($chunks[0] =~ /(^auto-generated-by:\s*(.*)\n?)/m)
163 4 1 if defined $sc and $sc =~ s/\s//
178 3 0 if defined $dc
188 1 8 if ($chunks[0] =~ /(^default_relationship_id_prefix:\s*(.*)\n?)/m)
197 9 0 if ($chunks[0] =~ /(^default-namespace:\s*(.*)\n?)/m)
212 0 9 unless (defined $format_version)
239 1 8 if $data_version
240 1 8 if $ontology_id_space
241 9 0 if $date
242 7 2 if $saved_by
248 1 8 if $default_relationship_id_prefix
249 9 0 if $default_namespace
254 0 9 if ($chunks[0])
294 2026 126 if ($stanza and $stanza =~ /\[Term\]/) { }
112 14 elsif ($stanza and $stanza =~ /\[Typedef\]/) { }
5 9 elsif ($stanza and $stanza =~ /\[Instance\]/) { }
0 18 elsif ($stanza and $stanza =~ /\[Annotation\]/) { }
310 2026 9997 if ($line =~ /^id:\s*(\S+)/) { }
2 9995 elsif ($line =~ /^is_anonymous:$r_true_false/) { }
2024 7971 elsif ($line =~ /^name:\s*(.*)/) { }
14 7957 elsif ($line =~ /^namespace:\s*(.*)/) { }
9 7948 elsif ($line =~ /^alt_id:$r_db_acc/) { }
1338 6610 elsif ($line =~ /^def:\s*\"(.*)\"$r_dbxref/) { }
194 6416 elsif ($line =~ /^comment:\s*(.*)/) { }
34 6382 elsif ($line =~ /^subset:\s*(\S+)/) { }
573 5809 elsif ($line =~ /^(exact|narrow|broad|related)_synonym:\s*\"(.*)\"$r_dbxref/) { }
1541 4268 elsif ($line =~ /^synonym:\s*\"(.*)\"$syn_scope(\s+([-\w]+))?$r_dbxref/) { }
1167 3101 elsif ($line =~ /^xref:\s*(.*)/ or $line =~ /^xref_analog:\s*(.*)/ or $line =~ /^xref_unknown:\s*(.*)/) { }
2149 952 elsif ($line =~ /^is_a:$r_db_acc$r_comments/) { }
2 950 elsif ($line =~ m[^intersection_of:\s*([\w/]+)?$r_db_acc$r_comments]) { }
0 950 elsif ($line =~ /^union_of:$r_db_acc$r_comments/) { }
15 935 elsif ($line =~ /^disjoint_from:$r_db_acc$r_comments/) { }
898 37 elsif ($line =~ m[^relationship:\s*([\w/]+)$r_db_acc$r_comments] or $line =~ /^relationship:\s*$r_db_acc$r_db_acc$r_comments/) { }
5 32 elsif ($line =~ /^created_by:\s*(.*)/) { }
5 27 elsif ($line =~ /^creation_date:\s*(.*)/) { }
0 27 elsif ($line =~ /^modified_by:\s*(.*)/) { }
0 27 elsif ($line =~ /^modification_date:\s*(.*)/) { }
20 7 elsif ($line =~ /^is_obsolete:$r_true_false/) { }
0 7 elsif ($line =~ /^replaced_by:\s*(.*)/) { }
0 7 elsif ($line =~ /^consider:\s*(.*)/) { }
0 7 elsif ($line =~ /^builtin:$r_true_false/) { }
6 1 elsif ($line =~ /^property_value:\s*(\w+)$r_db_acc/ or $line =~ m<^property_value:\s*(\w+)\s+"([ \302\260'\#~\w:\\\+\?\{\}\$/\(\)\[\]\.=&!%_,-]+)"$r_db_acc>) { }
1 0 elsif ($line =~ /^!/) { }
311 2026 0 if ($line =~ /^id:$r_db_acc/) { }
312 0 2026 if $only_one_id_tag_per_entry
314 1622 404 if (not defined $term) { }
0 808 elsif (defined $term->def->text and $term->def->text ne '') { }
327 2 0 $1 eq 'true' ? :
329 0 2024 if $only_one_name_tag_per_entry
330 0 2024 if (not defined $1) { }
349 34 0 if ($result->subset_def_map->contains_key($ss)) { }
359 1537 4 defined $3 ? :
362 5 1536 if (defined $5)
365 5 2 if ($st->name eq $5)
366 1 4 unless (defined $3)
368 1 0 if defined $default_scope
374 0 5 unless $found
383 0 2149 if ($t_id eq $1)
391 264 1885 unless (defined $target)
407 1 1 unless (defined $target)
418 0 0 unless (defined $target)
435 144 754 unless (defined $target)
447 0 5 unless ($pd)
459 0 0 unless ($pd)
464 20 0 $1 eq 'true' ? :
470 0 0 $1 eq 'true' ? :
478 6 0 unless (defined $r2_type)
492 1 5 if (not defined $last_match) { }
5 0 elsif (defined $last_match) { }
498 0 1 if (defined $target) { }
503 1 0 unless (defined $target)
520 5 0 unless (defined $target)
525 0 5 unless exists $allowed_data_types{$last_match}
546 0 2026 if (defined $term and not defined $term->id)
549 0 2026 if ($intersection_of_counter == 1)
552 0 2026 if ($union_of_counter == 1)
569 112 490 if ($line =~ /^id:\s*(.*)/) { }
0 490 elsif ($line =~ /^is_anonymous:$r_true_false/) { }
112 378 elsif ($line =~ /^name:\s*(.*)/) { }
0 378 elsif ($line =~ /^namespace:\s*(.*)/) { }
0 378 elsif ($line =~ /^alt_id:\s*([:\w]+)/) { }
59 319 elsif ($line =~ /^def:\s*\"(.*)\"$r_dbxref/) { }
36 283 elsif ($line =~ /^comment:\s*(.*)/) { }
1 282 elsif ($line =~ /^subset:\s*(\S+)/) { }
0 282 elsif ($line =~ /^domain:\s*(.*)/) { }
0 282 elsif ($line =~ /^range:\s*(.*)/) { }
13 269 elsif ($line =~ /^is_anti_symmetric:$r_true_false/) { }
0 269 elsif ($line =~ /^is_cyclic:$r_true_false/) { }
24 245 elsif ($line =~ /^is_reflexive:$r_true_false/) { }
2 243 elsif ($line =~ /^is_symmetric:$r_true_false/) { }
47 196 elsif ($line =~ /^is_transitive:$r_true_false/) { }
62 134 elsif ($line =~ /^is_a:\s*([:\w]+)$r_comments/) { }
0 134 elsif ($line =~ /^is_metadata_tag:$r_true_false/) { }
1 133 elsif ($line =~ /^is_class_level:$r_true_false/) { }
3 130 elsif ($line =~ /^(exact|narrow|broad|related)_synonym:\s*\"(.*)\"$r_dbxref/) { }
16 114 elsif ($line =~ /^synonym:\s*\"(.*)\"$syn_scope(\s+(\w+))?$r_dbxref/) { }
74 40 elsif ($line =~ /^xref:\s*(.*)/ or $line =~ /^xref_analog:\s*(.*)/ or $line =~ /^xref_unk:\s*(.*)/) { }
0 40 elsif ($line =~ m[^intersection_of:\s*([\w/]+)?$r_db_acc$r_comments]) { }
0 40 elsif ($line =~ /^union_of:\s*(.*)/) { }
1 39 elsif ($line =~ /^disjoint_from:\s*([:\w]+)$r_comments/) { }
13 26 elsif ($line =~ /^inverse_of:\s*([:\w]+)$r_comments/) { }
0 26 elsif ($line =~ /^transitive_over:\s*(.*)/) { }
14 12 elsif ($line =~ /^holds_over_chain:\s*([:\w]+)\s*([:\w]+)$r_comments/) { }
0 12 elsif ($line =~ /^equivalent_to_chain:\s*(.*)/) { }
0 12 elsif ($line =~ /^disjoint_over:\s*(.*)/) { }
0 12 elsif ($line =~ /^is_functional:$r_true_false/) { }
0 12 elsif ($line =~ /^is_inverse_functional:$r_true_false/) { }
2 10 elsif ($line =~ /^created_by:\s*(.*)/) { }
2 8 elsif ($line =~ /^creation_date:\s*(.*)/) { }
1 7 elsif ($line =~ /^modified_by:\s*(.*)/) { }
1 6 elsif ($line =~ /^modification_date:\s*(.*)/) { }
0 6 elsif ($line =~ /^is_obsolete:\s*(.*)/) { }
0 6 elsif ($line =~ /^replaced_by:\s*(.*)/) { }
0 6 elsif ($line =~ /^consider:\s*(.*)/) { }
5 1 elsif ($line =~ /^builtin:$r_true_false/) { }
1 0 elsif ($line =~ /^!/) { }
571 75 37 if (not defined $type) { }
0 37 elsif (defined $type->def->text and $type->def->text ne '') { }
585 0 0 $1 eq 'true' ? :
587 0 112 if $only_one_name_tag_per_entry
603 1 0 if ($result->subset_def_map->contains_key($ss)) { }
615 13 0 $1 eq 'true' ? :
617 0 0 $1 eq 'true' ? :
619 24 0 $1 eq 'true' ? :
621 2 0 $1 eq 'true' ? :
623 47 0 $1 eq 'true' ? :
627 0 62 if ($r_id eq $r)
635 7 55 unless (defined $target)
643 0 0 $1 eq 'true' ? :
645 1 0 $1 eq 'true' ? :
649 16 0 defined $3 ? :
652 0 16 if (defined $5)
656 0 0 if ($st->name eq $5)
659 0 0 if defined $default_scope
663 0 0 unless $found
678 0 0 unless (defined $target)
689 0 0 unless (defined $target)
701 9 4 unless (defined $inv_type)
714 2 12 unless (defined $r1_type)
720 1 13 unless (defined $r2_type)
731 0 0 $1 eq 'true' ? :
733 0 0 $1 eq 'true' ? :
739 0 2 unless ($pd)
748 0 1 unless ($pd)
753 0 0 $1 eq 'true' ? :
759 5 0 $1 eq 'true' ? :
767 0 112 unless (defined $type->id)
770 0 112 if ($intersection_of_counter == 1)
773 0 112 if ($union_of_counter == 1)
794 5 21 if ($line =~ /^id:\s*(\S+)/) { }
0 21 elsif ($line =~ /^is_anonymous:$r_true_false/) { }
5 16 elsif ($line =~ /^name:\s*(.*)/) { }
1 15 elsif ($line =~ /^namespace:\s*(.*)/) { }
0 15 elsif ($line =~ /^alt_id:$r_db_acc/) { }
0 15 elsif ($line =~ /^def:\s*\"(.*)\"$r_dbxref/) { }
0 15 elsif ($line =~ /^comment:\s*(.*)/) { }
0 15 elsif ($line =~ /^subset:\s*(\S+)/) { }
0 15 elsif ($line =~ /^(exact|narrow|broad|related)_synonym:\s*\"(.*)\"$r_dbxref/) { }
1 14 elsif ($line =~ /^synonym:\s*\"(.*)\"$syn_scope(\s+([-\w]+))?$r_dbxref/) { }
1 13 elsif ($line =~ /^xref:\s*(.*)/ or $line =~ /^xref_analog:\s*(.*)/ or $line =~ /^xref_unknown:\s*(.*)/) { }
5 8 elsif ($line =~ /^instance_of:$r_db_acc$r_comments/) { }
0 8 elsif ($line =~ m[^intersection_of:\s*([\w/]+)?$r_db_acc$r_comments]) { }
0 8 elsif ($line =~ /^union_of:\s*(.*)/) { }
0 8 elsif ($line =~ /^disjoint_from:$r_db_acc$r_comments/) { }
0 8 elsif ($line =~ m[^relationship:\s*([\w/]+)$r_db_acc$r_comments] or $line =~ /^relationship:\s*$r_db_acc$r_db_acc$r_comments/) { }
0 8 elsif ($line =~ /^created_by:\s*(.*)/) { }
0 8 elsif ($line =~ /^creation_date:\s*(.*)/) { }
0 8 elsif ($line =~ /^modified_by:\s*(.*)/) { }
0 8 elsif ($line =~ /^modification_date:\s*(.*)/) { }
0 8 elsif ($line =~ /^is_obsolete:$r_true_false/) { }
0 8 elsif ($line =~ /^replaced_by:\s*(.*)/) { }
0 8 elsif ($line =~ /^consider:\s*(.*)/) { }
0 8 elsif ($line =~ /^builtin:$r_true_false/) { }
8 0 elsif ($line =~ /^property_value:\s*(\w+)$r_db_acc/ or $line =~ m<^property_value:\s*(\w+)\s+"([ \302\260'\#~\w:\\\+\?\{\}\$/\(\)\[\]\.=&!%_,-]+)"$r_db_acc>) { }
0 0 elsif ($line =~ /^!/) { }
795 5 0 if ($line =~ /^id:$r_db_acc/) { }
796 0 5 if $only_one_id_tag_per_entry
798 3 2 unless (defined $instance)
812 0 0 $1 eq 'true' ? :
814 0 5 if $only_one_name_tag_per_entry
815 0 5 if (not defined $1) { }
835 0 0 if ($result->subset_def_map->contains_key($ss)) { }
845 1 0 defined $3 ? :
848 0 1 if (defined $5)
852 0 0 if ($st->name eq $5)
855 0 0 if defined $default_scope
859 0 0 unless $found
867 3 2 unless (defined $t)
883 0 0 unless (defined $target)
895 0 0 unless (defined $target)
913 0 0 unless (defined $target)
925 0 0 unless ($pd)
934 0 0 unless ($pd)
939 0 0 $1 eq 'true' ? :
946 0 0 $1 eq 'true' ? :
954 5 3 unless (defined $r2_type)
969 4 4 if (not defined $last_match) { }
4 0 elsif (defined $last_match) { }
975 0 4 if (defined $target) { }
980 3 1 unless (defined $target)
997 4 0 unless (defined $target)
1002 0 4 unless exists $allowed_data_types{$last_match}
1023 0 5 if (defined $instance and not defined $instance->id)
1026 0 5 if ($intersection_of_counter == 1)
1030 0 5 if ($union_of_counter == 1)
1044 0 19 unless ($used_subset{$pss})
1055 0 5 unless ($used_synonym_type_def{$st->name})
1064 0 9 unless ($result->has_relationship_type_id('is_a'))