| 1 | package Bio::ConnectDots::ConnectorSet::Unigene; | ||
| 2 | use strict; | ||
| 3 | use vars qw(@ISA); | ||
| 4 | use Bio::ConnectDots::ConnectorSet; | ||
| 5 | @ISA = qw(Bio::ConnectDots::ConnectorSet); | ||
| 6 | |||
| 7 | sub parse_entry { | ||
| 8 | my ($self) = @_; | ||
| 9 | my $input_fh=$self->input_fh; | ||
| 10 | |||
| 11 | while (<$input_fh>) { | ||
| 12 | chomp; | ||
| 13 | if (/^\/\//) { | ||
| 14 | next unless $self->have_dots; | ||
| 15 | return 1; | ||
| 16 | } | ||
| 17 | if (/^ID/) { | ||
| 18 | my ($field, $id) = split /\s+/; | ||
| 19 | $self->put_dot('UniGene',$id); | ||
| 20 | |||
| 21 | if ($id =~ /^Hs/) { | ||
| 22 | $self->put_dot('Organism', 'Homo sapiens'); | ||
| 23 | } | ||
| 24 | |||
| 25 | if ($id =~ /^Mm/) { | ||
| 26 | $self->put_dot('Organism', 'Mus musculus'); | ||
| 27 | } | ||
| 28 | if ($id =~ /^Rn/) { | ||
| 29 | $self->put_dot('Organism', 'Rattus norvegicus'); | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | if (/^TITLE/) { | ||
| 34 | my ($field, @title) = split /\s+/; | ||
| 35 | $self->put_dot('Gene_Name',join(' ',@title)); | ||
| 36 | } | ||
| 37 | if (/^GENE/) { | ||
| 38 | my ($field, $gene) = split /\s+/; | ||
| 39 | $self->put_dot('Gene_Symbol', $gene); | ||
| 40 | } | ||
| 41 | if (/^LOCUSLINK/) { | ||
| 42 | my ($field, @locuslink) = split /\s+/; | ||
| 43 | foreach my $tmp (@locuslink) { | ||
| 44 | $tmp =~ s/;//g; | ||
| 45 | $self->put_dot('LocusLink',$tmp); | ||
| 46 | } | ||
| 47 | } | ||
| 48 | if (/^CHROMOSOME/) { | ||
| 49 | my ($field, $chromosome) = split /\s+/; | ||
| 50 | $self->put_dot('Chromosome',$chromosome); | ||
| 51 | } | ||
| 52 | if (/^STS/) { | ||
| 53 | my ($field, $Acc, $sts) = split /=/; | ||
| 54 | $sts =~ s/\s+//; | ||
| 55 | if ($sts ne '-') { | ||
| 56 | $self->put_dot( 'STS', $sts); | ||
| 57 | } | ||
| 58 | } | ||
| 59 | if (/^SEQUENCE/) { | ||
| 60 | my @field = split /\s+/; | ||
| 61 | foreach my $tmp (@field) { | ||
| 62 | |||
| 63 | if ($tmp =~ /ACC=/) { | ||
| 64 | $tmp =~ s/ACC=//; | ||
| 65 | $tmp =~ s/\.\d+;//; | ||
| 66 | $self->put_dot( 'Sequence_Accession', $tmp); | ||
| 67 | } | ||
| 68 | if ($tmp =~ /CLONE=/) { | ||
| 69 | $tmp =~ s/CLONE=//; | ||
| 70 | $tmp =~ s/;//; | ||
| 71 | $self->put_dot('Clone', $tmp); | ||
| 72 | } | ||
| 73 | if ($tmp =~ /LID=/) { | ||
| 74 | $tmp =~ s/LID=//; | ||
| 75 | $tmp =~ s/;//; | ||
| 76 | $self->put_dot('LID', $tmp); | ||
| 77 | } | ||
| 78 | if ($tmp =~ /MGC=/){ | ||
| 79 | $tmp =~ s/MGC=//; | ||
| 80 | $tmp =~ s/;//; | ||
| 81 | $self->put_dot('MGC', $tmp); | ||
| 82 | } | ||
| 83 | } #foreach | ||
| 84 | |||
| 85 | } #if /^SEQUENCE/ | ||
| 86 | |||
| 87 | } #end of while | ||
| 88 | return undef; | ||
| 89 | } #end of sub | ||
| 90 | |||
| 91 | 1; |