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

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3