[Bio] / FigKernelPackages / SeedUtils.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/SeedUtils.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Mon Aug 3 21:31:42 2009 UTC revision 1.5, Wed Aug 19 17:05:13 2009 UTC
# Line 23  Line 23 
23      use Tracer;      use Tracer;
24      use base qw(Exporter);      use base qw(Exporter);
25    
26      our @EXPORT = qw(create_fasta_record rev_comp genome_of);      our @EXPORT = qw(create_fasta_record rev_comp genome_of min max);
27    
28  =head1 SEED Utility Methods  =head1 SEED Utility Methods
29    
# Line 34  Line 34 
34    
35  =head2 Public Methods  =head2 Public Methods
36    
37    =head3 max
38    
39        my $max = max(@nums);
40    
41    Return the maximum number from all the values in the specified list.
42    
43    =over 4
44    
45    =item nums
46    
47    List of numbers to examine.
48    
49    =item RETURN
50    
51    Returns the maximum numeric value from the specified parameters, or
52    an undefined value if an empty list is passed in.
53    
54    =back
55    
56    =cut
57    
58    sub max {
59        my ($retVal, @nums) = @_;
60        for my $num (@nums) {
61            if ($num > $retVal) {
62                $retVal = $num;
63            }
64        }
65        return $retVal;
66    }
67    
68    =head3 min
69    
70        my $min = min(@nums);
71    
72    Return the minimum number from all the values in the specified list.
73    
74    =over 4
75    
76    =item nums
77    
78    List of numbers to examine.
79    
80    =item RETURN
81    
82    Returns the minimum numeric value from the specified parameters, or
83    an undefined value if an empty list is passed in.
84    
85    =back
86    
87    =cut
88    
89    sub min {
90        my ($retVal, @nums) = @_;
91        for my $num (@nums) {
92            if ($num < $retVal) {
93                $retVal = $num;
94            }
95        }
96        return $retVal;
97    }
98    
99  =head3 create_fasta_record  =head3 create_fasta_record
100    
101      my $fastaString = create_fasta_record($id, $comment, $sequence);      my $fastaString = create_fasta_record($id, $comment, $sequence);

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3