ConnectorSet/OMIM.pm untested

filter: Statementstmt 0.0% 0 / 42 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 63 CC 9 SCAR 42.2
CC
9
Cov
0%
parse_entry
90.0
BEGIN
2.0
BEGIN
2.0
CRAP 68.0
1 package Bio::ConnectDots::ConnectorSet::OMIM;
2  
3 use strict;
4 use vars qw(@ISA);
5 use Bio::ConnectDots::ConnectorSet;
6 @ISA = qw(Bio::ConnectDots::ConnectorSet);
7  
8 sub parse_entry {
9 my ($self) = @_;
10 my $input_fh = $self->input_fh;
11  
12 while (<$input_fh>) {
13 chomp;
14 if (/^\*RECORD\*/) {
15 next unless $self->have_dots;
16 return 1;
17 }
18 if (/^\*FIELD\* NO/) {
19 $_ = <$input_fh>;
20 chomp;
21 $self->put_dot( 'OMIM', $_ );
22 }
23 if (/^\*FIELD\* TI/) {
24 my $title;
25 $_ = <$input_fh>;
26 chomp;
27 $title = $_;
28 # attach extra titles
29 while (!/^\*/) {
30 $_ = <$input_fh>;
31 if(!/^\*/) {
32 chomp;
33 $title .= " $_";
34 }
35 }
36 my @titles = split (/;;/, $title);
37 $self->put_dot('Title', shift @titles);
38 foreach my $alt (@titles) {
39 # handle whitespace
40 $alt =~ s/^\s*//;
41 $alt =~ s/\s*$//;
42 $alt =~ s/\s+/ /;
43 $self->put_dot('Alternate_Title', $alt) if $alt;
44 }
45
46 }
47 if (/^\*RECORD\*/) {
48 next unless $self->have_dots;
49 return 1;
50 }
51 } #end of while
52 return undef;
53 }
54  
55 1;