annotate [APliBio]Nebula tools suite/Nebula/Peak2Bed/peak2bed.pl @ 0:2ec3ba0e9e70 draft

Uploaded
author alermine
date Thu, 25 Oct 2012 08:18:25 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
1 #:t:::::::::::::::::g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
2 #:t::::::::::::::;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
3 #:::::::::::::z;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
4 #::::::::::::i@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
5 #::::::::::::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
6 #:::::::::::3@@@@@@@@@@@@@@@@@@@@@@@@@B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
7 #::::::::::3@@@@@@@@@@@@@@@@@@@@@BEEESSE5EEEEBBM@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
8 #::::::::::3@@@@@@@@@@@@@@@@@@@@BEEEEEE35EE55E2355E5SBMB@@@@@@@@@@@@@@@@@$
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
9 #::::::::::@@@@@@@@@@@@@@@@@@@EEEE55533t3tttt::::::!!!!7755E755SBBMMM@@@MM
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
10 #::::::::::3@@@@@@@@@@@@@@@@@@EEEE2t3ttttt:::::::::::::::::::::::!7?5225EE
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
11 #::::::::::3@@@@@@@@@@@@@@@@@@EEEEE31t::::::::::::::::::::::::::::::::3E5@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
12 #::::::::::3@@@@@@@@@@@@@@@@@@EEEEEEtt:::::::::::::::::::::::::::::::::353
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
13 #::::::::::3@@@@@@@@@@@@@@@@@@EEEEEE1ttz::::::::::::::::::::::::::::::::35
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
14 #:::::::::::@@@@@@@@@@@@@@@@@@EEEEEEEtz1::::::::::::::::::::::::::::::::t:
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
15 #:::::::::!3@@@@@@@@@@@@@@@@@@@EEEEEttt::::::::::::::::::::::::::::::::;zz
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
16 #::::::::::@@@@@@@@@@@@@@@@@@@@EEEEEttt:::::z;z:::::::::::::::::::::::::13
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
17 #::::::::::3B@@@@@@@@@@@@@@@@@@EEEEEEE3tt:czzztti;:::::::::::::::::::::::3
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
18 #::::ttt::::3@@@@@@@@@@@@@@@@EEEEE5EE25Ezt1EEEz5Etzzz;;;;:::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
19 #:::::::::::I9@@@@@@@@@@@@@@@@@@@@@@@@@@EEEEEE@@@@@@@@@@@@@@Ez;:::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
20 #:::::::::::::E@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Ez::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
21 #::::::::::::::E@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BE5EBB@@@@@@@@@@@@@@@EEE:::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
22 #:::::::::::::::@@@@@@@@@@@@@@@@@@@@@@@@@@@@E1::35@@@@@@@@@@ME3MMME2::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
23 #:::::::::::::::?@@@@@@@@@@@@@@@@@@M@@@@@@@EE:::::3SB@@BBESEEt::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
24 #::::::::::::::::J$@@@@@@@B@@@@@@@@@@@@@@@@EE:::::::!35E33t:::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
25 #:::::::::::::::::3@E@@@EE5EESE5EESE@@@@@@@Et::::::::::::tz:::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
26 #:::::::::::::::::J@E$@EEE5133555SE@@@@@@@@Et:::::::::::::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
27 #::::::::::::::::::E@E@EEEEtt3523EEE@@@@@@@E::::::::::::::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
28 #:t::::::::::::::::JEE3@@@EEEEEEEEEE@@@@@@@E:::::::::t;:::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
29 #:t:::::::::::::::::!5ES@EEEEEEEEES@@@@@@@@@E;:::;;;:3Ez::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
30 #:t::::::::::::::::::::JE@@EEEEEEE@@@@@@@@@@@@@@@@ME!:::;:::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
31 #:tz::::::::::::::::::::JE@@@EEEE@@@@@@@@@@@@@@EE!:::::::t::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
32 #:t::::::::::::::::::::::3@@@@@@@@@@@@@@@@@@ESBE::::::::::::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
33 #:::::::::::::::::::::::::Q@@@@@@@@@@@@@@@@EE3EE;:::::zzzz::::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
34 #:::::::::::::::::::::::::3@@@@@@@@@@@@@@@@@@@@@@NN@@@@@@Ez:::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
35 #:zt:::::::::::::::::::::::3@@@@EE@@@@@@@@@@EEEEt::;z113E5t:::::::::::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
36 #::tt:::::::::::::::::::::::3@@@E@@@@@@@@@@@@@@@@BEt::::::::::::::::t:::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
37 #:tt:t:::::::::::::::::::::::?S@@@@@@@@@@@BBEEE51!::::::::::::::zzzEt:::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
38 #::::::::::::::::::::::::::::::3Q@@@@@@@BEEEEEt:::::::::::::;zz@@@EE::::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
39 #::::::::::::::::::::::::::::::::75B@@@@@EEEtt;:::::::::;zz@@@@BEEEtz:::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
40 #::::::::::::::::::::::::::::::::::::?9@@@@@@@@@@@E2Ezg@@@@@B@@@EEEE1t::::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
41 #:::::::::::::::::::::::::::::::::::::::3@@@@@@@@@@@@@@@@@@@E@EEEEEEEzzz::
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
42 #::::::::::::::::::::::::::::::::::::;@@@@@@@@@@@@@@@@@@@@@@@EEEEEEE5ttttt
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
43 #:::::::::::::::::::::::::::::::;g@@@@@@@@@@@@@@@@@@@@@@@@@@EEEEEEEEEEEtzt
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
44 #::::::::::::::::::::::::::::;@@@@@@@@@@@@@@@@@@@@@@@@@@E@@EEEEEEEEEEEE@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
45 #::::::::::::::::::::::::::g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@EEEE3EEEE@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
46 #:::::::::::::::::::::;;g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@EEEt33@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
47 #:::::::::::::::::;g@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@@@EEEtg@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
48 #::::::::::::::;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@EEEE@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
49 #:::::::::::::@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
50 #::::::::::;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
51 #
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
52 # Copyleft ↄ⃝ 2012 Institut Curie
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
53 # Author(s): Valentina Boeva, Alban Lermine (Institut Curie) 2012
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
54 # Contact: valentina.boeva@curie.fr, alban.lermine@curie.fr
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
55 # This software is distributed under the terms of the GNU General
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
56 # Public License, either Version 2, June 1991 or Version 3, June 2007.
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
57
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
58 #!/usr/bin/perl
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
59
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
60 use strict;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
61 use warnings;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
62 use diagnostics;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
63
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
64 my $usage = qq{
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
65 $0
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
66
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
67 -----------------------------
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
68 mandatory parameters:
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
69
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
70 -f peaks
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
71 -t min peak height
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
72 -o output file
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
73
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
74 -----------------------------
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
75 optional parameters:
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
76 -n name
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
77 none
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
78 };
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
79
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
80 if(scalar(@ARGV) == 0){
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
81 print $usage;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
82 exit(0);
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
83 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
84
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
85 ## mandatory arguments
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
86
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
87 my $filename = "";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
88 my $output_fname = "";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
89
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
90 my $minPeakH = 0;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
91
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
92 my $chromLengthsFile="";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
93 my $expName = "User Track";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
94
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
95 ## optional arguments
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
96
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
97 ## parse command line arguments
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
98
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
99 while(scalar(@ARGV) > 0){
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
100 my $this_arg = shift @ARGV;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
101 if ( $this_arg eq '-h') {print "$usage\n"; exit; }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
102
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
103 elsif ( $this_arg eq '-f') {$filename = shift @ARGV;}
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
104 elsif ( $this_arg eq '-t') {$minPeakH = shift @ARGV;}
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
105 elsif ( $this_arg eq '-o') {$output_fname = shift @ARGV;}
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
106 elsif ( $this_arg eq '-g') {$chromLengthsFile = shift @ARGV;}
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
107 elsif ( $this_arg eq '-n') {$expName = shift @ARGV;}
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
108 elsif ( $this_arg =~ m/^-/ ) { print "unknown flag: $this_arg\n";}
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
109 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
110
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
111 if ( $filename eq ""){
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
112 die "you should specify chip file\n";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
113 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
114 if( $output_fname eq ""){
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
115 die "you should specify output filename\n";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
116 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
117
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
118 $minPeakH-=0.5 unless ($minPeakH=~m/0\.5/);
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
119
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
120 #read chromosome lengths if provided:
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
121 my %max;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
122 if ($chromLengthsFile ne "") {
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
123 open FILE, "< $chromLengthsFile " || die "$chromLengthsFile : $!\n";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
124 while(<FILE>){
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
125 chomp;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
126 if (/(chr\S+)\s(\d+)/) {
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
127 $max{$1}=$2;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
128 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
129 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
130 close FILE;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
131 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
132
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
133 ######
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
134
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
135 print "\n-----------------\n\n";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
136
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
137 my %hash;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
138 my $chipCount = 0;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
139 my @header;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
140
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
141
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
142 open FILE, "< $filename " || die "$filename : $!\n";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
143 open OUT, "> $output_fname" || die "$output_fname: $!\n";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
144 print OUT "track name=\'$expName\' description=\'$expName\'\n";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
145 my $count = 0;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
146 my $scount = 0;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
147
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
148 while(<FILE>){
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
149 chomp;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
150 next if (/max/);
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
151 next if (/track/);
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
152 next if (/^\#/);
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
153 my @fields = split(/\t/,$_);
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
154 my $entry = $fields[1]."\t".$fields[2]."\t".$fields[3];
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
155 $count++;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
156 if ($fields[5]>=$minPeakH) {
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
157 $scount ++;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
158 $fields[1]= "chr".$fields[1] unless ($fields[1]=~m/chr/);
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
159
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
160 if ($chromLengthsFile ne "") {my $maxV = $max{$fields[1]}; $fields[2]= min($fields[2],$maxV);$fields[3]=min($fields[3],$maxV);$fields[4]=min($fields[4],$maxV); }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
161 print OUT join("\t",$fields[1],$fields[2],$fields[3],$fields[4],$fields[5],"+",$fields[2],$fields[3],"255,120,11","1",$fields[3]-$fields[2],0,"\n");
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
162 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
163 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
164
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
165 close FILE;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
166 close OUT;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
167 print "read: $count peaks; selected: $scount\n";
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
168
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
169 sub min {
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
170 my ($a,$b) = @_;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
171 if($a<$b){
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
172 return $a;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
173 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
174 $b;
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
175 }
2ec3ba0e9e70 Uploaded
alermine
parents:
diff changeset
176