[Bio] / Sprout / Sprout.pm Repository:
ViewVC logotype

Diff of /Sprout/Sprout.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.90, Fri Sep 29 15:10:05 2006 UTC revision 1.92, Mon Oct 16 07:41:50 2006 UTC
# Line 3149  Line 3149 
3149      # Loop through the input triples.      # Loop through the input triples.
3150      my $n = length $sequence;      my $n = length $sequence;
3151      for (my $i = 0; $i < $n; $i += 3) {      for (my $i = 0; $i < $n; $i += 3) {
3152          # Get the current triple from the sequence.          # Get the current triple from the sequence. Note we convert to
3153          my $triple = substr($sequence, $i, 3);          # upper case to insure a match.
3154            my $triple = uc substr($sequence, $i, 3);
3155          # Translate it using the table.          # Translate it using the table.
3156          my $protein = "X";          my $protein = "X";
3157          if (exists $table->{$triple}) { $protein = $table->{$triple}; }          if (exists $table->{$triple}) { $protein = $table->{$triple}; }
# Line 3699  Line 3700 
3700      $self->Insert('HasProperty', { 'from-link' => $featureID, 'to-link' => $propID, evidence => $url });      $self->Insert('HasProperty', { 'from-link' => $featureID, 'to-link' => $propID, evidence => $url });
3701  }  }
3702    
3703    =head2 Virtual Methods
3704    
3705    =head3 CleanKeywords
3706    
3707    C<< my $cleanedString = $sprout->CleanKeywords($searchExpression); >>
3708    
3709    Clean up a search expression or keyword list. This involves converting the periods
3710    in EC numbers to underscores, converting non-leading minus signs to underscores,
3711    a vertical bar or colon to an apostrophe, and forcing lower case for all alphabetic
3712    characters. In addition, any extra spaces are removed.
3713    
3714    =over 4
3715    
3716    =item searchExpression
3717    
3718    Search expression or keyword list to clean. Note that a search expression may
3719    contain boolean operators which need to be preserved. This includes leading
3720    minus signs.
3721    
3722    =item RETURN
3723    
3724    Cleaned expression or keyword list.
3725    
3726    =back
3727    
3728    =cut
3729    
3730    sub CleanKeywords {
3731        # Get the parameters.
3732        my ($self, $searchExpression) = @_;
3733        # Perform the standard cleanup.
3734        my $retVal = $self->ERDB::CleanKeywords($searchExpression);
3735        # Fix the periods in EC and TC numbers.
3736        $retVal =~ s/(\d+|\-)\.(\d+|-)\.(\d+|-)\.(\d+|-)/$1_$2_$3_$4/g;
3737        # Fix non-trailing periods.
3738        $retVal =~ s/\.(\w)/_$1/g;
3739        # Fix non-leading minus signs.
3740        $retVal =~ s/(\w)[\-]/$1_/g;
3741        # Fix the vertical bars and colons
3742        $retVal =~ s/(\w)[|:](\w)/$1'$2/g;
3743        # Return the result.
3744        return $retVal;
3745    }
3746    
3747  =head2 Internal Utility Methods  =head2 Internal Utility Methods
3748    
3749  =head3 ParseAssignment  =head3 ParseAssignment

Legend:
Removed from v.1.90  
changed lines
  Added in v.1.92

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3