[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.40, Wed Oct 12 03:12:24 2005 UTC revision 1.43, Tue Oct 18 18:36:26 2005 UTC
# Line 610  Line 610 
610          if ($prevContig eq $contigID && $dir eq $prevDir) {          if ($prevContig eq $contigID && $dir eq $prevDir) {
611              # Here the new segment is in the same direction on the same contig. Insure the              # Here the new segment is in the same direction on the same contig. Insure the
612              # new segment's beginning is next to the old segment's end.              # new segment's beginning is next to the old segment's end.
613              if (($dir eq "-" && $beg == $prevBeg - $prevLen) ||              if ($dir eq "-" && $beg + $len == $prevBeg) {
614                  ($dir eq "+" && $beg == $prevBeg + $prevLen)) {                  # Here we're merging two backward blocks, so we keep the new begin point
615                  # Here we need to merge two segments. Adjust the beginning and length values                  # and adjust the length.
616                  # to include both segments.                  $len += $prevLen;
617                    # Pop the old segment off. The new one will replace it later.
618                    pop @retVal;
619                } elsif ($dir eq "+" && $beg == $prevBeg + $prevLen) {
620                    # Here we need to merge two forward blocks. Adjust the beginning and
621                    # length values to include both segments.
622                  $beg = $prevBeg;                  $beg = $prevBeg;
623                  $len += $prevLen;                  $len += $prevLen;
624                  # Pop the old segment off. The new one will replace it later.                  # Pop the old segment off. The new one will replace it later.
# Line 2604  Line 2609 
2609                                      ['HasSSCell(from-link)', 'IsRoleOf(from-link)']);                                      ['HasSSCell(from-link)', 'IsRoleOf(from-link)']);
2610      # Create the return value.      # Create the return value.
2611      my %retVal = ();      my %retVal = ();
2612        # Build a hash to weed out duplicates. Sometimes the same PEG and role appears
2613        # in two spreadsheet cells.
2614        my %dupHash = ();
2615      # Loop through the results, adding them to the hash.      # Loop through the results, adding them to the hash.
2616      for my $record (@subsystems) {      for my $record (@subsystems) {
2617            # Get this subsystem and role.
2618          my ($subsys, $role) = @{$record};          my ($subsys, $role) = @{$record};
2619          if (exists $retVal{$subsys}) {          # Insure it's the first time for both.
2620            my $dupKey = "$subsys\n$role";
2621            if (! exists $dupHash{"$subsys\n$role"}) {
2622                $dupHash{$dupKey} = 1;
2623              push @{$retVal{$subsys}}, $role;              push @{$retVal{$subsys}}, $role;
         } else {  
             $retVal{$subsys} = [$role];  
2624          }          }
2625      }      }
2626      # Return the hash.      # Return the hash.
# Line 3179  Line 3189 
3189      # Declare the return value.      # Declare the return value.
3190      my @retVal = ();      my @retVal = ();
3191      # Check to see if this is a functional assignment.      # Check to see if this is a functional assignment.
3192      my ($user, $type, $function) = split(/\n/, $text);      my ($type, $function) = split(/\n/, $text);
3193      if ($type =~ m/^set ([^ ]+) function to$/i) {      if ($type =~ m/^set ([^ ]+) function to$/i) {
3194          # Here it is, so we return the user name (which is in $1), the functional role text,          # Here it is, so we return the user name (which is in $1), the functional role text,
3195          # and the assigning user.          # and the assigning user.
3196          @retVal = ($1, $function, $user);          @retVal = ($1, $function);
3197      }      }
3198      # Return the result list.      # Return the result list.
3199      return @retVal;      return @retVal;

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.43

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3