[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.1, Sun Jan 23 16:12:29 2005 UTC revision 1.6, Wed Jan 26 17:41:53 2005 UTC
# Line 11  Line 11 
11          use Tracer;          use Tracer;
12          use FIGRules;          use FIGRules;
13          use Stats;          use Stats;
14        use POSIX qw(strftime);
15    
16    
17  =head1 Sprout Database Manipulation Object  =head1 Sprout Database Manipulation Object
# Line 33  Line 34 
34    
35  =cut  =cut
36    
37  #  #: Constructor SFXlate->new_sprout_only();
38    
39  =head2 Public Methods  =head2 Public Methods
40    
# Line 121  Line 122 
122  and 10999.  and 10999.
123    
124  =cut  =cut
125    #: Return Type $;
126  sub MaxSegment {  sub MaxSegment {
127          my $self = shift @_;          my $self = shift @_;
128          return $self->{_options}->{maxSegmentLength};          return $self->{_options}->{maxSegmentLength};
# Line 136  Line 137 
137  we generally only need a few sequences in memory rather than the entire contig.  we generally only need a few sequences in memory rather than the entire contig.
138    
139  =cut  =cut
140    #: Return Type $;
141  sub MaxSequence {  sub MaxSequence {
142          my $self = shift @_;          my $self = shift @_;
143          return $self->{_options}->{maxSequenceLength};          return $self->{_options}->{maxSequenceLength};
# Line 305  Line 306 
306  =back  =back
307    
308  =cut  =cut
309    #: Return Type @;
310  sub GetEntityValues {  sub GetEntityValues {
311          # Get the parameters.          # Get the parameters.
312          my $self = shift @_;          my $self = shift @_;
# Line 378  Line 379 
379  =back  =back
380    
381  =cut  =cut
382    #: Return Type %;
383  sub Load {  sub Load {
384          # Get the parameters.          # Get the parameters.
385          my $self = shift @_;          my $self = shift @_;
# Line 422  Line 423 
423  =back  =back
424    
425  =cut  =cut
426    #: Return Type %;
427  sub LoadUpdate {  sub LoadUpdate {
428          # Get the parameters.          # Get the parameters.
429          my $self = shift @_;          my $self = shift @_;
# Line 459  Line 460 
460  changed.  changed.
461    
462  =cut  =cut
463    #: Return Type ;
464  sub Build {  sub Build {
465          # Get the parameters.          # Get the parameters.
466          my $self = shift @_;          my $self = shift @_;
# Line 474  Line 475 
475  Return a list of all the genome IDs.  Return a list of all the genome IDs.
476    
477  =cut  =cut
478    #: Return Type @;
479  sub Genomes {  sub Genomes {
480          # Get the parameters.          # Get the parameters.
481          my $self = shift @_;          my $self = shift @_;
# Line 504  Line 505 
505  =back  =back
506    
507  =cut  =cut
508    #: Return Type $;
509  sub GenusSpecies {  sub GenusSpecies {
510          # Get the parameters.          # Get the parameters.
511          my $self = shift @_;          my $self = shift @_;
# Line 541  Line 542 
542  =back  =back
543    
544  =cut  =cut
545    #: Return Type @;
546  sub FeaturesOf {  sub FeaturesOf {
547          # Get the parameters.          # Get the parameters.
548          my $self = shift @_;          my $self = shift @_;
# Line 594  Line 595 
595  =back  =back
596    
597  =cut  =cut
598    #: Return Type @;
599    #: Return Type $;
600  sub FeatureLocation {  sub FeatureLocation {
601          # Get the parameters.          # Get the parameters.
602          my $self = shift @_;          my $self = shift @_;
# Line 656  Line 658 
658  =back  =back
659    
660  =cut  =cut
661    #: Return Type @;
662  sub ParseLocation {  sub ParseLocation {
663          # Get the parameter.          # Get the parameter.
664          my ($location) = @_;          my ($location) = @_;
# Line 682  Line 684 
684  C<< my $sequence = $sprout->DNASeq(\@locationList); >>  C<< my $sequence = $sprout->DNASeq(\@locationList); >>
685    
686  This method returns the DNA sequence represented by a list of locations. The list of locations  This method returns the DNA sequence represented by a list of locations. The list of locations
687  should be of the form returned by L</feature_location> 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,
688  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>.
689    
690  =over 4  =over 4
# Line 699  Line 701 
701  =back  =back
702    
703  =cut  =cut
704    #: Return Type $;
705  sub DNASeq {  sub DNASeq {
706          # Get the parameters.          # Get the parameters.
707          my $self = shift @_;          my $self = shift @_;
# Line 773  Line 775 
775  =back  =back
776    
777  =cut  =cut
778    #: Return Type @;
779  sub AllContigs {  sub AllContigs {
780          # Get the parameters.          # Get the parameters.
781          my $self = shift @_;          my $self = shift @_;
# Line 797  Line 799 
799    
800  ID of the contig whose length is desired.  ID of the contig whose length is desired.
801    
802    =item RETURN
803    
804    Returns the number of positions in the contig.
805    
806  =back  =back
807    
808  =cut  =cut
809    #: Return Type $;
810  sub ContigLength {  sub ContigLength {
811          # Get the parameters.          # Get the parameters.
812          my $self = shift @_;          my $self = shift @_;
# Line 851  Line 857 
857  =back  =back
858    
859  =cut  =cut
860    #: Return Type @;
861  sub GenesInRegion {  sub GenesInRegion {
862          # Get the parameters.          # Get the parameters.
863          my $self = shift @_;          my $self = shift @_;
# Line 934  Line 940 
940  =back  =back
941    
942  =cut  =cut
943    #: Return Type $;
944  sub FType {  sub FType {
945          # Get the parameters.          # Get the parameters.
946          my $self = shift @_;          my $self = shift @_;
# Line 963  Line 969 
969    
970  * B<featureID> ID of the relevant feature.  * B<featureID> ID of the relevant feature.
971    
972  * B<timeStamp> time the annotation was made.  * B<timeStamp> time the annotation was made, in user-friendly format.
973    
974  * B<user> ID of the user who made the annotation  * B<user> ID of the user who made the annotation
975    
# Line 972  Line 978 
978  =back  =back
979    
980  =cut  =cut
981    #: Return Type @%;
982  sub FeatureAnnotations {  sub FeatureAnnotations {
983          # Get the parameters.          # Get the parameters.
984          my $self = shift @_;          my $self = shift @_;
# Line 990  Line 996 
996                                                                   'Annotation(time)', 'MadeAnnotation(from-link)',                                                                   'Annotation(time)', 'MadeAnnotation(from-link)',
997                                                                   'Annotation(annotation)']);                                                                   'Annotation(annotation)']);
998                  # Assemble them into a hash.                  # Assemble them into a hash.
999                  my $annotationHash = { featureID => $featureID, timeStamp => $timeStamp,          my $annotationHash = { featureID => $featureID,
1000                                   timeStamp => FriendlyTimestamp($timeStamp),
1001                                                             user => $user, text => $text };                                                             user => $user, text => $text };
1002                  # Add it to the return list.                  # Add it to the return list.
1003                  push @retVal, $annotationHash;                  push @retVal, $annotationHash;
# Line 1008  Line 1015 
1015  It has the format "XXXX\nset XXXX function to\nYYYYY". In this instance, XXXX is the user ID  It has the format "XXXX\nset XXXX function to\nYYYYY". In this instance, XXXX is the user ID
1016  and YYYYY is the functional assignment text. Its worth noting that we cannot filter on the content  and YYYYY is the functional assignment text. Its worth noting that we cannot filter on the content
1017  of the annotation itself because it's a text field; however, this is not a big problem because most  of the annotation itself because it's a text field; however, this is not a big problem because most
1018  features only have a small number of annotations.  features only have a small number of annotations. Finally, if a single user has multiple
1019    functional assignments, we will only keep the most recent one.
1020    
1021  =over 4  =over 4
1022    
# Line 1016  Line 1024 
1024    
1025  ID of the feature whose functional assignments are desired.  ID of the feature whose functional assignments are desired.
1026    
1027    =item RETURN
1028    
1029    Returns a hash mapping the functional assignment IDs to user IDs.
1030    
1031  =back  =back
1032    
1033  =cut  =cut
1034    #: Return Type %;
1035  sub AllFunctionsOf {  sub AllFunctionsOf {
1036          # Get the parameters.          # Get the parameters.
1037          my $self = shift @_;          my $self = shift @_;
1038          my ($featureID) = @_;          my ($featureID) = @_;
1039          # Get all of the feature's annotations.          # Get all of the feature's annotations.
1040          my @query = $self->GetFlat(['IsTargetOfAnnotation', 'Annotation'],      my @query = $self->GetAll(['IsTargetOfAnnotation', 'Annotation'],
1041                                                      "IsTargetOfAnnotation(from-link) = ?",                                                      "IsTargetOfAnnotation(from-link) = ?",
1042                                                          [$featureID], 'Annotation(annotation)');                              [$featureID], ['Annotation(time)', 'Annotation(annotation)']);
1043          # Declare the return hash.          # Declare the return hash.
1044          my %retVal;          my %retVal;
1045        # Declare a hash for insuring we only make one assignment per user.
1046        my %timeHash = ();
1047        # Now we sort the assignments by timestamp in reverse.
1048        my @sortedQuery = sort { -($a->[0] <=> $b->[0]) } @query;
1049          # Loop until we run out of annotations.          # Loop until we run out of annotations.
1050          for my $text (@query) {      for my $annotation (@sortedQuery) {
1051            # Get the annotation fields.
1052            my ($timeStamp, $text) = @{$annotation};
1053                  # Check to see if this is a functional assignment.                  # Check to see if this is a functional assignment.
1054                  my ($user, $function) = ParseAssignment($text);                  my ($user, $function) = ParseAssignment($text);
1055                  if ($user) {          if ($user && ! exists $timeHash{$user}) {
1056                          # Here it is, so stuff it in the return hash.              # Here it is a functional assignment and there has been no
1057                # previous assignment for this user, so we stuff it in the
1058                # return hash.
1059                          $retVal{$function} = $user;                          $retVal{$function} = $user;
1060                # Insure we don't assign to this user again.
1061                $timeHash{$user} = 1;
1062                  }                  }
1063          }          }
1064          # Return the hash of assignments found.          # Return the hash of assignments found.
# Line 1047  Line 1069 
1069    
1070  C<< my $functionText = $sprout->FunctionOf($featureID, $userID); >>  C<< my $functionText = $sprout->FunctionOf($featureID, $userID); >>
1071    
1072  Return the most recently-determined functional assignment of a particular feature. A functional  Return the most recently-determined functional assignment of a particular feature.
1073    
1074    The functional assignment is handled differently depending on the type of feature. If
1075    the feature is identified by a FIG ID (begins with the string C<fig|>), then a functional
1076  assignment is a type of annotation. It has the format "XXXX\nset XXXX function to\nYYYYY". In this  assignment is a type of annotation. It has the format "XXXX\nset XXXX function to\nYYYYY". In this
1077  instance, XXXX is the user ID and YYYYY is the functional assignment text. Its worth noting that  instance, XXXX is the user ID and YYYYY is the functional assignment text. Its worth noting that
1078  we cannot filter on the content of the annotation itself because it's a text field; however, this  we cannot filter on the content of the annotation itself because it's a text field; however, this
1079  is not a big problem because most features only have a small number of annotations.  is not a big problem because most features only have a small number of annotations.
1080    
1081    Each user has an associated list of trusted users. The assignment returned will be the most
1082    recent one by at least one of the trusted users. If no trusted user list is available, then
1083    the specified user and FIG are considered trusted. If the user ID is omitted, only FIG
1084    is trusted.
1085    
1086    If the feature is B<not> identified by a FIG ID, then the functional assignment
1087    information is taken from the B<ExternalAliasFunc> table. If the table does
1088    not contain an entry for the feature, an undefined value is returned.
1089    
1090  =over 4  =over 4
1091    
1092  =item featureID  =item featureID
# Line 1061  Line 1095 
1095    
1096  =item userID (optional)  =item userID (optional)
1097    
1098  ID of the user whose function determination is desired. If omitted, C<FIG> is assumed.  ID of the user whose function determination is desired. If omitted, only the latest
1099    C<FIG> assignment will be returned.
1100    
1101  =item RETURN  =item RETURN
1102    
# Line 1070  Line 1105 
1105  =back  =back
1106    
1107  =cut  =cut
1108    #: Return Type $;
1109  sub FunctionOf {  sub FunctionOf {
1110          # Get the parameters.          # Get the parameters.
1111          my $self = shift @_;          my $self = shift @_;
1112          my ($featureID, $userID) = @_;          my ($featureID, $userID) = @_;
1113          if (!$userID) { $userID = 'FIG'; }      # Declare the return value.
         # Build a query for all of the feature's annotation, sorted by date.  
         my $query = $self->Get(['IsTargetOfAnnotation', 'Annotation'],  
                                                     "IsTargetOfAnnotation(from-link) = ?", [$featureID]);  
         # Declare the return value. We'll set this to the most recent annotation for the  
         # specified user.  
1114          my $retVal;          my $retVal;
1115        # Determine the ID type.
1116        if ($featureID =~ m/^fig\|/) {
1117            # Here we have a FIG feature ID. We must build the list of trusted
1118            # users.
1119            my %trusteeTable = ();
1120            # Check the user ID.
1121            if (!$userID) {
1122                # No user ID, so only FIG is trusted.
1123                $trusteeTable{FIG} = 1;
1124            } else {
1125                # Add this user's ID.
1126                $trusteeTable{$userID} = 1;
1127                # Look for the trusted users in the database.
1128                my @trustees = $self->GetFlat(['IsTrustedBy'], 'IsTrustedBy(from-link) = ?', [$userID], 'IsTrustedBy(to-link)');
1129                if (! @trustees) {
1130                    # None were found, so build a default list.
1131                    $trusteeTable{FIG} = 1;
1132                } else {
1133                    # Otherwise, put all the trustees in.
1134                    for my $trustee (@trustees) {
1135                        $trusteeTable{$trustee} = 1;
1136                    }
1137                }
1138            }
1139            # Build a query for all of the feature's annotations, sorted by date.
1140            my $query = $self->Get(['IsTargetOfAnnotation', 'Annotation'],
1141                                   "IsTargetOfAnnotation(from-link) = ? ORDER BY Annotation(time) DESC",
1142                                   [$featureID]);
1143          my $timeSelected = 0;          my $timeSelected = 0;
1144          # Loop until we run out of annotations.          # Loop until we run out of annotations.
1145          while (my $annotation = $query->Fetch()) {          while (my $annotation = $query->Fetch()) {
1146                  # Get the annotation text.                  # Get the annotation text.
1147                  my ($text, $time) = $annotation->Values(['Annotation(annotation)','Annotation(time)']);                  my ($text, $time) = $annotation->Values(['Annotation(annotation)','Annotation(time)']);
1148                  # Check to see if this is a functional assignment for the desired user.              # Check to see if this is a functional assignment for a trusted user.
1149                  my ($user, $type, $function) = split(/\n/, $text);                  my ($user, $type, $function) = split(/\n/, $text);
1150                  if ($type =~ m/^set $userID function to$/i) {              if ($type =~ m/^set $user function to$/i) {
1151                          # Here it is, so we check the time and save the assignment value.                  # Here it is a functional assignment. Check the time and the user
1152                          if ($time > $timeSelected) {                  # name. The time must be recent and the user must be trusted.
1153                    if ((exists $trusteeTable{$user}) && ($time > $timeSelected)) {
1154                                  $retVal = $function;                                  $retVal = $function;
1155                                  $timeSelected = $time;                                  $timeSelected = $time;
1156                          }                          }
1157                  }                  }
1158          }          }
1159        } else {
1160            # Here we have a non-FIG feature ID. In this case the user ID does not
1161            # matter. We simply get the information from the External Alias Function
1162            # table.
1163            ($retVal) = $self->GetEntityValues('ExternalAliasFunc', $featureID, ['ExternalAliasFunc(func)']);
1164        }
1165          # Return the assignment found.          # Return the assignment found.
1166          return $retVal;          return $retVal;
1167  }  }
# Line 1126  Line 1191 
1191  =back  =back
1192    
1193  =cut  =cut
1194    #: Return Type %;
1195  sub BBHList {  sub BBHList {
1196          # Get the parameters.          # Get the parameters.
1197          my $self = shift @_;          my $self = shift @_;
# Line 1170  Line 1235 
1235  =back  =back
1236    
1237  =cut  =cut
1238    #: Return Type @;
1239  sub FeatureAliases {  sub FeatureAliases {
1240          # Get the parameters.          # Get the parameters.
1241          my $self = shift @_;          my $self = shift @_;
# Line 1201  Line 1266 
1266  =back  =back
1267    
1268  =cut  =cut
1269    #: Return Type $;
1270  sub GenomeOf {  sub GenomeOf {
1271          # Get the parameters.          # Get the parameters.
1272          my $self = shift @_;          my $self = shift @_;
# Line 1238  Line 1303 
1303  =back  =back
1304    
1305  =cut  =cut
1306    #: Return Type %;
1307  sub CoupledFeatures {  sub CoupledFeatures {
1308          # Get the parameters.          # Get the parameters.
1309          my $self = shift @_;          my $self = shift @_;
# Line 1275  Line 1340 
1340  Return the list of supported entity types.  Return the list of supported entity types.
1341    
1342  =cut  =cut
1343    #: Return Type @;
1344  sub GetEntityTypes {  sub GetEntityTypes {
1345          # Get the parameters.          # Get the parameters.
1346          my $self = shift @_;          my $self = shift @_;
# Line 1310  Line 1375 
1375  =back  =back
1376    
1377  =cut  =cut
1378    #: Return Type %;
1379  sub ReadFasta {  sub ReadFasta {
1380          # Get the parameters.          # Get the parameters.
1381          my ($fileName, $prefix) = @_;          my ($fileName, $prefix) = @_;
# Line 1378  Line 1443 
1443  =back  =back
1444    
1445  =cut  =cut
1446    #: Return Type @;
1447  sub FormatLocations {  sub FormatLocations {
1448          # Get the parameters.          # Get the parameters.
1449          my $self = shift @_;          my $self = shift @_;
# Line 1436  Line 1501 
1501  Return the name of this database's XML definition file.  Return the name of this database's XML definition file.
1502    
1503  =cut  =cut
1504    #: Return Type $;
1505  sub XMLFileName {  sub XMLFileName {
1506          my $self = shift @_;          my $self = shift @_;
1507          return $self->{_xmlName};          return $self->{_xmlName};
# Line 1473  Line 1538 
1538  =back  =back
1539    
1540  =cut  =cut
1541    #: Return Type ;
1542  sub Insert {  sub Insert {
1543          # Get the parameters.          # Get the parameters.
1544          my $self = shift @_;          my $self = shift @_;
# Line 1515  Line 1580 
1580  =back  =back
1581    
1582  =cut  =cut
1583    #: Return Type $;
1584  sub Annotate {  sub Annotate {
1585          # Get the parameters.          # Get the parameters.
1586          my $self = shift @_;          my $self = shift @_;
# Line 1566  Line 1631 
1631  =back  =back
1632    
1633  =cut  =cut
1634    #: Return Type $;
1635  sub AssignFunction {  sub AssignFunction {
1636          # Get the parameters.          # Get the parameters.
1637          my $self = shift @_;          my $self = shift @_;
# Line 1614  Line 1679 
1679  =back  =back
1680    
1681  =cut  =cut
1682    #: Return Type @;
1683  sub FeaturesByAlias {  sub FeaturesByAlias {
1684          # Get the parameters.          # Get the parameters.
1685          my $self = shift @_;          my $self = shift @_;
# Line 1657  Line 1722 
1722  =back  =back
1723    
1724  =cut  =cut
1725    #: Return Type $;
1726  sub Exists {  sub Exists {
1727          # Get the parameters.          # Get the parameters.
1728          my $self = shift @_;          my $self = shift @_;
# Line 1688  Line 1753 
1753  =back  =back
1754    
1755  =cut  =cut
1756    #: Return Type $;
1757  sub FeatureTranslation {  sub FeatureTranslation {
1758          # Get the parameters.          # Get the parameters.
1759          my $self = shift @_;          my $self = shift @_;
# Line 1721  Line 1786 
1786  =back  =back
1787    
1788  =cut  =cut
1789    #: Return Type @;
1790  sub Taxonomy {  sub Taxonomy {
1791          # Get the parameters.          # Get the parameters.
1792          my $self = shift @_;          my $self = shift @_;
# Line 1765  Line 1830 
1830  =back  =back
1831    
1832  =cut  =cut
1833    #: Return Type $;
1834  sub CrudeDistance {  sub CrudeDistance {
1835          # Get the parameters.          # Get the parameters.
1836          my $self = shift @_;          my $self = shift @_;
# Line 1813  Line 1878 
1878  =back  =back
1879    
1880  =cut  =cut
1881    #: Return Type $;
1882  sub RoleName {  sub RoleName {
1883          # Get the parameters.          # Get the parameters.
1884          my $self = shift @_;          my $self = shift @_;
# Line 1847  Line 1912 
1912  =back  =back
1913    
1914  =cut  =cut
1915    #: Return Type @;
1916  sub RoleDiagrams {  sub RoleDiagrams {
1917          # Get the parameters.          # Get the parameters.
1918          my $self = shift @_;          my $self = shift @_;
# Line 1885  Line 1950 
1950  =back  =back
1951    
1952  =cut  =cut
1953    #: Return Type @@;
1954  sub FeatureProperties {  sub FeatureProperties {
1955          # Get the parameters.          # Get the parameters.
1956          my $self = shift @_;          my $self = shift @_;
# Line 1917  Line 1982 
1982  =back  =back
1983    
1984  =cut  =cut
1985    #: Return Type $;
1986  sub DiagramName {  sub DiagramName {
1987          # Get the parameters.          # Get the parameters.
1988          my $self = shift @_;          my $self = shift @_;
# Line 1950  Line 2015 
2015  =back  =back
2016    
2017  =cut  =cut
2018    #: Return Type @;
2019  sub MergedAnnotations {  sub MergedAnnotations {
2020          # Get the parameters.          # Get the parameters.
2021          my $self = shift @_;          my $self = shift @_;
# Line 1969  Line 2034 
2034          }          }
2035          # Sort the result list by timestamp.          # Sort the result list by timestamp.
2036          my @retVal = sort { $a->[1] <=> $b->[1] } @tuples;          my @retVal = sort { $a->[1] <=> $b->[1] } @tuples;
2037        # Loop through and make the time stamps friendly.
2038        for my $tuple (@retVal) {
2039            $tuple->[1] = FriendlyTimestamp($tuple->[1]);
2040        }
2041          # Return the sorted list.          # Return the sorted list.
2042          return @retVal;          return @retVal;
2043  }  }
# Line 1995  Line 2064 
2064  =back  =back
2065    
2066  =cut  =cut
2067    #: Return Type @;
2068  sub RoleNeighbors {  sub RoleNeighbors {
2069          # Get the parameters.          # Get the parameters.
2070          my $self = shift @_;          my $self = shift @_;
# Line 2038  Line 2107 
2107  =back  =back
2108    
2109  =cut  =cut
2110    #: Return Type @;
2111  sub FeatureLinks {  sub FeatureLinks {
2112          # Get the parameters.          # Get the parameters.
2113          my $self = shift @_;          my $self = shift @_;
# Line 2069  Line 2138 
2138  =back  =back
2139    
2140  =cut  =cut
2141    #: Return Type %;
2142  sub SubsystemsOf {  sub SubsystemsOf {
2143          # Get the parameters.          # Get the parameters.
2144          my $self = shift @_;          my $self = shift @_;
# Line 2118  Line 2187 
2187  =back  =back
2188    
2189  =cut  =cut
2190    #: Return Type @;
2191  sub RelatedFeatures {  sub RelatedFeatures {
2192          # Get the parameters.          # Get the parameters.
2193          my $self = shift @_;          my $self = shift @_;
# Line 2167  Line 2236 
2236  =back  =back
2237    
2238  =cut  =cut
2239    #: Return Type @;
2240  sub TaxonomySort {  sub TaxonomySort {
2241          # Get the parameters.          # Get the parameters.
2242          my $self = shift @_;          my $self = shift @_;
# Line 2250  Line 2319 
2319  =back  =back
2320    
2321  =cut  =cut
2322    #: Return Type @@;
2323  sub GetAll {  sub GetAll {
2324          # Get the parameters.          # Get the parameters.
2325          my $self = shift @_;          my $self = shift @_;
# Line 2312  Line 2381 
2381  =back  =back
2382    
2383  =cut  =cut
2384    #: Return Type @;
2385  sub GetFlat {  sub GetFlat {
2386          # Get the parameters.          # Get the parameters.
2387          my $self = shift @_;          my $self = shift @_;
# Line 2423  Line 2492 
2492  to load the entire database.  to load the entire database.
2493    
2494  =cut  =cut
2495    #: Return Type @;
2496  sub LoadInfo {  sub LoadInfo {
2497          # Get the parameters.          # Get the parameters.
2498          my $self = shift @_;          my $self = shift @_;
# Line 2460  Line 2529 
2529  =back  =back
2530    
2531  =cut  =cut
2532    #: Return Type %;
2533  sub LowBBHs {  sub LowBBHs {
2534          # Get the parsameters.          # Get the parsameters.
2535          my $self = shift @_;          my $self = shift @_;
# Line 2520  Line 2589 
2589          return @retVal;          return @retVal;
2590  }  }
2591    
2592    =head3 FriendlyTimestamp
2593    
2594    Convert a time number to a user-friendly time stamp for display.
2595    
2596    This is a static method.
2597    
2598    =over 4
2599    
2600    =item timeValue
2601    
2602    Numeric time value.
2603    
2604    =item RETURN
2605    
2606    Returns a string containing the same time in user-readable format.
2607    
2608    =back
2609    
2610    =cut
2611    
2612    sub FriendlyTimestamp {
2613        my ($timeValue) = @_;
2614        my $retVal = strftime("%a %b %e %H:%M:%S %Y", localtime($timeValue));
2615        return $retVal;
2616    }
2617    
2618  1;  1;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3