[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.80, Thu Aug 10 07:34:37 2006 UTC revision 1.82, Sat Sep 2 07:00:54 2006 UTC
# Line 3400  Line 3400 
3400      return $retVal;      return $retVal;
3401  }  }
3402    
3403    =head3 Fix
3404    
3405    C<< my %fixedHash = Sprout::Fix(%groupHash); >>
3406    
3407    Prepare a genome group hash (like that returned by L</GetGroups> for processing.
3408    Groups with the same primary name will be combined. The primary name is the
3409    first capitalized word in the group name.
3410    
3411    =over 4
3412    
3413    =item groupHash
3414    
3415    Hash to be fixed up.
3416    
3417    =item RETURN
3418    
3419    Returns a fixed-up version of the hash.
3420    
3421    =back
3422    
3423    =cut
3424    
3425    sub Fix {
3426        # Get the parameters.
3427        my (%groupHash) = @_;
3428        # Create the result hash.
3429        my %retVal = ();
3430        # Copy over the genomes.
3431        for my $groupID (keys %groupHash) {
3432            # Make a safety copy of the group ID.
3433            my $realGroupID = $groupID;
3434            # Yank the primary name.
3435            if ($groupID =~ /([A-Z]\w+)/) {
3436                $realGroupID = $1;
3437            }
3438            # Append this group's genomes into the result hash.
3439            Tracer::AddToListMap(\%retVal, $realGroupID, @{$groupHash{$groupID}});
3440        }
3441        # Return the result hash.
3442        return %retVal;
3443    }
3444    
3445  =head2 Internal Utility Methods  =head2 Internal Utility Methods
3446    
3447  =head3 ParseAssignment  =head3 ParseAssignment
# Line 3456  Line 3498 
3498      }      }
3499      # If we have an assignment, we need to clean the function text. There may be      # If we have an assignment, we need to clean the function text. There may be
3500      # extra junk at the end added as a note from the user.      # extra junk at the end added as a note from the user.
3501      if (@retVal > 1) {      if (defined( $retVal[1] )) {
3502          $retVal[1] =~ s/(\t\S)?\s*$//;          $retVal[1] =~ s/(\t\S)?\s*$//;
3503      }      }
3504      # Return the result list.      # Return the result list.

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.82

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3