[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.52, Mon Dec 12 21:48:57 2005 UTC revision 1.56, Wed Apr 19 03:34:15 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 1522  Line 1527 
1527    
1528  C<< my $genomeID = $sprout->GenomeOf($featureID); >>  C<< my $genomeID = $sprout->GenomeOf($featureID); >>
1529    
1530  Return the genome that contains a specified feature.  Return the genome that contains a specified feature or contig.
1531    
1532  =over 4  =over 4
1533    
1534  =item featureID  =item featureID
1535    
1536  ID of the feature whose genome is desired.  ID of the feature or contig whose genome is desired.
1537    
1538  =item RETURN  =item RETURN
1539    
1540  Returns the ID of the genome for the specified feature. If the feature is not found, returns  Returns the ID of the genome for the specified feature or contig. If the feature or contig is not
1541  an undefined value.  found, returns an undefined value.
1542    
1543  =back  =back
1544    
# Line 1542  Line 1547 
1547  sub GenomeOf {  sub GenomeOf {
1548      # Get the parameters.      # Get the parameters.
1549      my ($self, $featureID) = @_;      my ($self, $featureID) = @_;
1550      # Create a query to find the genome associated with the feature.      # Create a query to find the genome associated with the incoming ID.
1551      my $query = $self->Get(['IsLocatedIn', 'HasContig'], "IsLocatedIn(from-link) = ?", [$featureID]);      my $query = $self->Get(['IsLocatedIn', 'HasContig'], "IsLocatedIn(from-link) = ? OR HasContig(to-link) = ?",
1552                               [$featureID, $featureID]);
1553      # Declare the return value.      # Declare the return value.
1554      my $retVal;      my $retVal;
1555      # Get the genome ID.      # Get the genome ID.
# Line 2730  Line 2736 
2736      return @retVal;      return @retVal;
2737  }  }
2738    
2739    
2740    
2741  =head3 RelatedFeatures  =head3 RelatedFeatures
2742    
2743  C<< my @relatedList = $sprout->RelatedFeatures($featureID, $function, $userID); >>  C<< my @relatedList = $sprout->RelatedFeatures($featureID, $function, $userID); >>
# Line 3221  Line 3229 
3229      return $retVal;      return $retVal;
3230  }  }
3231    
3232    =head3 DeleteGenome
3233    
3234    C<< my $stats = $sprout->DeleteGenome($genomeID, $testFlag); >>
3235    
3236    Delete a genome from the database.
3237    
3238    =over 4
3239    
3240    =item genomeID
3241    
3242    ID of the genome to delete
3243    
3244    =item testFlag
3245    
3246    If TRUE, then the DELETE statements will be traced, but no deletions will occur.
3247    
3248    =item RETURN
3249    
3250    Returns a statistics object describing the rows deleted.
3251    
3252    =back
3253    
3254    =cut
3255    #: Return Type $%;
3256    sub DeleteGenome {
3257        # Get the parameters.
3258        my ($self, $genomeID, $testFlag) = @_;
3259        # Perform the delete for the genome's features.
3260        my $retVal = $self->{_erdb}->Delete('Feature', "fig|$genomeID.%", $testFlag);
3261        # Perform the delete for the primary genome data.
3262        my $stats = $self->{_erdb}->Delete('Genome', $genomeID, $testFlag);
3263        $retVal->Accumulate($stats);
3264        # Return the result.
3265        return $retVal;
3266    }
3267    
3268  =head2 Internal Utility Methods  =head2 Internal Utility Methods
3269    
3270  =head3 ParseAssignment  =head3 ParseAssignment

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.56

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3