[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.49, Thu Oct 20 18:03:43 2005 UTC revision 1.55, Mon Apr 3 18:33:58 2006 UTC
# Line 92  Line 92 
92                                                          # database type                                                          # database type
93                         dataDir      => $FIG_Config::sproutData,                         dataDir      => $FIG_Config::sproutData,
94                                                          # data file directory                                                          # data file directory
95                         xmlFileName  => "$FIG_Config::sproutData/SproutDBD.xml",                         xmlFileName  => "$FIG_Config::fig/SproutDBD.xml",
96                                                          # database definition file name                                                          # database definition file name
97                         userData     => "$FIG_Config::dbuser/$FIG_Config::dbpass",                         userData     => "$FIG_Config::dbuser/$FIG_Config::dbpass",
98                                                          # user name and password                                                          # user name and password
# Line 740  Line 740 
740  should be of the form returned by L</featureLocation> when in a list context. In other words,  should be of the form returned by L</featureLocation> when in a list context. In other words,
741  each location is of the form I<contigID>C<_>I<begin>I<dir>I<end>.  each location is of the form I<contigID>C<_>I<begin>I<dir>I<end>.
742    
743    For example, the following would return the DNA sequence for contig C<83333.1:NC_000913>
744    between positions 1401 and 1532, inclusive.
745    
746        my $sequence = $sprout->DNASeq('83333.1:NC_000913_1401_1532');
747    
748  =over 4  =over 4
749    
750  =item locationList  =item locationList
751    
752  List of location specifiers, each in the form I<contigID>C<_>I<begin>I<dir>I<end> (see  List of location specifiers, each in the form I<contigID>C<_>I<begin>I<dir>I<len> or
753  L</FeatureLocation> for more about this format).  I<contigID>C<_>I<begin>C<_>I<end> (see L</FeatureLocation> for more about this format).
754    
755  =item RETURN  =item RETURN
756    
# Line 1274  Line 1279 
1279              if ($actualUser) {              if ($actualUser) {
1280                  # Here it is a functional assignment. Check the time and the user                  # Here it is a functional assignment. Check the time and the user
1281                  # name. The time must be recent and the user must be trusted.                  # name. The time must be recent and the user must be trusted.
1282                  if ((exists $trusteeTable{$user}) && ($time > $timeSelected)) {                  if ((exists $trusteeTable{$actualUser}) && ($time > $timeSelected)) {
1283                      $retVal = $function;                      $retVal = $function;
1284                      $timeSelected = $time;                      $timeSelected = $time;
1285                  }                  }
# Line 1482  Line 1487 
1487      my $genomeData = $self->GetEntity('Genome', $genomeID);      my $genomeData = $self->GetEntity('Genome', $genomeID);
1488      if ($genomeData) {      if ($genomeData) {
1489          # The genome exists, so get the completeness flag.          # The genome exists, so get the completeness flag.
1490          ($retVal) = $genomeData->Value('complete');          ($retVal) = $genomeData->Value('Genome(complete)');
1491      }      }
1492      # Return the result.      # Return the result.
1493      return $retVal;      return $retVal;
# Line 3221  Line 3226 
3226      return $retVal;      return $retVal;
3227  }  }
3228    
3229    =head3 DeleteGenome
3230    
3231    C<< my $stats = $sprout->DeleteGenome($genomeID, $testFlag); >>
3232    
3233    Delete a genome from the database.
3234    
3235    =over 4
3236    
3237    =item genomeID
3238    
3239    ID of the genome to delete
3240    
3241    =item testFlag
3242    
3243    If TRUE, then the DELETE statements will be traced, but no deletions will occur.
3244    
3245    =item RETURN
3246    
3247    Returns a statistics object describing the rows deleted.
3248    
3249    =back
3250    
3251    =cut
3252    #: Return Type $%;
3253    sub DeleteGenome {
3254        # Get the parameters.
3255        my ($self, $genomeID, $testFlag) = @_;
3256        # Perform the delete for the genome's features.
3257        my $retVal = $self->{_erdb}->Delete('Feature', "fig|$genomeID.%", $testFlag);
3258        # Perform the delete for the primary genome data.
3259        my $stats = $self->{_erdb}->Delete('Genome', $genomeID, $testFlag);
3260        $retVal->Accumulate($stats);
3261        # Return the result.
3262        return $retVal;
3263    }
3264    
3265  =head2 Internal Utility Methods  =head2 Internal Utility Methods
3266    
3267  =head3 ParseAssignment  =head3 ParseAssignment
# Line 3237  Line 3278 
3278  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
3279  not always the case.  not always the case.
3280    
3281    In addition, the functional role may contain extra data that is stripped, such as
3282    terminating spaces or a comment separated from the rest of the text by a tab.
3283    
3284  This is a static method.  This is a static method.
3285    
3286  =over 4  =over 4
# Line 3269  Line 3313 
3313          # 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.
3314          @retVal = ($user, $function);          @retVal = ($user, $function);
3315      } elsif ($type =~ m/^set (\S+) function to$/i) {      } elsif ($type =~ m/^set (\S+) function to$/i) {
3316          # 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.
3317          @retVal = ($1, $function);          @retVal = ($1, $function);
3318      }      }
3319        # If we have an assignment, we need to clean the function text. There may be
3320        # extra junk at the end added as a note from the user.
3321        if (@retVal) {
3322            $retVal[1] =~ s/(\t\S)?\s*$//;
3323        }
3324      # Return the result list.      # Return the result list.
3325      return @retVal;      return @retVal;
3326  }  }
# Line 3359  Line 3408 
3408      $self->Insert('HasProperty', { 'from-link' => $featureID, 'to-link' => $propID, evidence => $url });      $self->Insert('HasProperty', { 'from-link' => $featureID, 'to-link' => $propID, evidence => $url });
3409  }  }
3410    
3411    
3412  1;  1;

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.55

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3