168d167 < my $genename = ""; 210,214c209,211 < elsif(/^GN\s+(.*)/) { < $genename .= " " if $genename; < $genename .= $1; < # has GN terminated yet? < if($genename =~ s/[\. ]+$//) { --- > elsif(/^GN\s+/) { > my $genename_rowsref = $self->_read_swissprot_GeneNames($_); > if (defined $genename_rowsref->[0]) { 216,220c213,215 < foreach my $gene (split(/ AND /, $genename)) { < $gene =~ s/^\(//; < $gene =~ s/\)$//; < $gn->add_value([-1,-1], split(/ OR /, $gene)); < } --- > foreach my $row (@$genename_rowsref) { > $gn->add_value([-1,-1], @$row); > } 223c218 < } --- > } 301c296,297 < --- > > 1005a1002,1004 > > > 1281a1281,1332 > =head2 _read_swissprot_GeneNames > > Title : _read_swissprot_GeneNames > Usage : > Function: Reads gene names from new swissprot format. Internal function. > Example : > Returns : > Args : > > > =cut > > sub _read_swissprot_GeneNames { > my ($self,$line) = @_; > my @genename_rows; > my $genename = ""; # for parsing the old format > local $_ = $line; > while( defined $_ ) { > if (/GN\s+Name=([^;]+);\s+Synonyms=(.+);/) { > push @genename_rows, [$1, split(/;\s+/, $2)]; > } > elsif (/Name=([^;]+)/) { > push @genename_rows, [$1]; > } > elsif (/GN\s+and/ and @genename_rows) { > # nothing - skip "GN and" lines in new format > } > elsif (/GN\s+(.+)/) { > # old format line > $genename .= " " if $genename; > $genename .= $1; > } > else { # not GN line > $self->_pushback($_); # want this line to go back on the list > last; > } > > # has the old-style GN terminated yet? > if($genename =~ s/[\. ]+$//) { > foreach my $gene (split(/ AND /, $genename)) { > $gene =~ s/^\(//; > $gene =~ s/\)$//; > push @genename_rows, [split(/ OR /, $gene)]; > } > } > $_ = $self->_readline; > > } > > return \@genename_rows; > } >