| 1 | package Bio::ConnectDots::ConnectorSet::ENZYME; | ||
| 2 | |||
| 3 | # parser for ENZYME database file at: | ||
| 4 | # ftp://au.expasy.org/databases/enzyme/release_with_updates/enzyme.dat | ||
| 5 | |||
| 6 | use strict; | ||
| 7 | use vars qw(@ISA); | ||
| 8 | use Bio::ConnectDots::ConnectorSet; | ||
| 9 | @ISA = qw(Bio::ConnectDots::ConnectorSet); | ||
| 10 | |||
| 11 | sub parse_entry { | ||
| 12 | my ($self) = @_; | ||
| 13 | my $input_fh = $self->input_fh; | ||
| 14 | |||
| 15 | while (<$input_fh>) { | ||
| 16 | chomp; | ||
| 17 | if (/^\/\//) { | ||
| 18 | next unless $self->have_dots; | ||
| 19 | return 1; | ||
| 20 | } #end of if | ||
| 21 | |||
| 22 | if (/^ID/) { | ||
| 23 | my ( $field, $ECnumber ) = split /\s+/; | ||
| 24 | $self->put_dot( 'ECnumber', $ECnumber ); | ||
| 25 | } | ||
| 26 | |||
| 27 | if (/^DE/) { | ||
| 28 | /^DE\s+(.+)/; | ||
| 29 | my $gene_name = $1; | ||
| 30 | chomp($gene_name); | ||
| 31 | $self->put_dot( 'Official_GeneName', $gene_name ); | ||
| 32 | } #end if DE | ||
| 33 | |||
| 34 | if (/^AN/) { | ||
| 35 | /^AN\s+(.+)/; | ||
| 36 | my $alt_name = $1; | ||
| 37 | chomp($alt_name); | ||
| 38 | $self->put_dot( 'Alias_Symbol', $alt_name ); | ||
| 39 | } | ||
| 40 | |||
| 41 | if (/^PR/) { | ||
| 42 | my @PR = split /\s+/; | ||
| 43 | if ( $PR[1] eq 'PROSITE;' ) { | ||
| 44 | chop( $PR[2] ); | ||
| 45 | $PR[2] =~ s/;$//g; | ||
| 46 | $self->put_dot( 'PROSITE', $PR[2] ); | ||
| 47 | } | ||
| 48 | } # end of PR | ||
| 49 | |||
| 50 | if (/^DR/) { | ||
| 51 | s/^DR\s+//; # remove ident | ||
| 52 | s/\s+//g; # remove whitespace | ||
| 53 | my @DR = split /[,;]/; | ||
| 54 | my $i = 0; | ||
| 55 | while ( $DR[$i] ) { | ||
| 56 | my $ac_num = @DR[$i]; | ||
| 57 | chomp($ac_num); | ||
| 58 | $ac_num =~ s/-\d//g; | ||
| 59 | $self->put_dot( 'SwissProt', $ac_num ); | ||
| 60 | $i += 2; # skip over Entry_name (i.e. GPD2_YEAST;) | ||
| 61 | } | ||
| 62 | } #if DR | ||
| 63 | } #end of while | ||
| 64 | return undef; | ||
| 65 | } #end of sub | ||
| 66 | |||
| 67 | 1; |