[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.51, Thu Dec 8 18:02:52 2005 UTC revision 1.53, Sat Jan 28 08:59:17 2006 UTC
# Line 3221  Line 3221 
3221      return $retVal;      return $retVal;
3222  }  }
3223    
3224    =head3 DeleteGenome
3225    
3226    C<< my $stats = $sprout->DeleteGenome($genomeID, $testFlag); >>
3227    
3228    Delete a genome from the database.
3229    
3230    =over 4
3231    
3232    =item genomeID
3233    
3234    ID of the genome to delete
3235    
3236    =item testFlag
3237    
3238    If TRUE, then the DELETE statements will be traced, but no deletions will occur.
3239    
3240    =item RETURN
3241    
3242    Returns a statistics object describing the rows deleted.
3243    
3244    =back
3245    
3246    =cut
3247    #: Return Type $%;
3248    sub DeleteGenome {
3249        # Get the parameters.
3250        my ($self, $genomeID, $testFlag) = @_;
3251        # Perform the delete for the genome's features.
3252        my $retVal = $self->{_erdb}->Delete('Feature', "fig|$genomeID.%", $testFlag);
3253        # Perform the delete for the primary genome data.
3254        my $stats = $self->{_erdb}->Delete('Genome', $genomeID, $testFlag);
3255        $retVal->Accumulate($stats);
3256        # Return the result.
3257        return $retVal;
3258    }
3259    
3260  =head2 Internal Utility Methods  =head2 Internal Utility Methods
3261    
3262  =head3 ParseAssignment  =head3 ParseAssignment
# Line 3237  Line 3273 
3273  the user and the assigning user (from MadeAnnotation) will be the same, but that is  the user and the assigning user (from MadeAnnotation) will be the same, but that is
3274  not always the case.  not always the case.
3275    
3276    In addition, the functional role may contain extra data that is stripped, such as
3277    terminating spaces or a comment separated from the rest of the text by a tab.
3278    
3279  This is a static method.  This is a static method.
3280    
3281  =over 4  =over 4
# Line 3269  Line 3308 
3308          # Here we have an assignment without a user, so we use the incoming user ID.          # Here we have an assignment without a user, so we use the incoming user ID.
3309          @retVal = ($user, $function);          @retVal = ($user, $function);
3310      } elsif ($type =~ m/^set (\S+) function to$/i) {      } elsif ($type =~ m/^set (\S+) function to$/i) {
3311          # Here we have an assignment with a user, that is passed back to the caller.          # Here we have an assignment with a user that is passed back to the caller.
3312          @retVal = ($1, $function);          @retVal = ($1, $function);
3313      }      }
3314        # If we have an assignment, we need to clean the function text. There may be
3315        # extra junk at the end added as a note from the user.
3316        if (@retVal) {
3317            $retVal[1] =~ s/(\t\S)?\s*$//;
3318        }
3319      # Return the result list.      # Return the result list.
3320      return @retVal;      return @retVal;
3321  }  }

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.53

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3