Debian Codegraph @

seagen/analysis/dumpScores.pl

raw
1 #!/usr/local/bin/perl
2
3 #
4 #
5 #
6
7 my $currentestid = -1;
8 my $outprefix;
9 my @outline;
10 my $num = 0;
11
12 my $maxscore = 0;
13
14 while ($currentestid < 222439) {
15 $_ = <STDIN>;
16
17 my ($dir, $junk, $estid, $junk, $chr, $beg, $end, $junk, $s1, $s2, $sm, $junk, $i, $c) = split '\s+', $_;
18
19 if ($currentestid == $estid) {
20 push @outline, "$s1,$s2,$i,$c";
21 $maxscore = $sm;
22 $num++;
23 } else {
24 @outline = sort { $b <=> $a } @outline;
25
26 if (defined($outprefix)) {
27 print "$outprefix\t$maxscore\t$num\t";
28
29 my $a = $,;
30 my $b = $\;
31 $, = " ";
32 $\ = "\n";
33
34 print @outline;
35
36 $, = $a;
37 $\ = $b;
38 }
39
40 $currentestid = $estid;
41 $outprefix = "$estid";
42
43 undef @outline;
44
45 push @outline, "$s1,$s2,$i,$c";
46 $maxscore = $sm;
47 $num = 1;
48 }
49 }
50