1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#!/usr/bin/env perl
use strict;
my @totals;
foreach my $file ( @ARGV )
{
open IN, "<$file" or die $!;
# eat headers
#
<IN>;
<IN>;
my $i = 0;
while ( my $line = <IN> )
{
my @vals = split /,/, $line;
for ( my $j = 0; $j < 3; $j++ )
{
$totals[$i][$j] += $vals[$j + 2];
}
$i++;
}
close IN;
}
print ",,,Human\n";
print ",,top hit,hit,no hit\n";
print ",top hit,", join(',', @{$totals[0]}), "\n";
print "NHP,hit,", join(',', @{$totals[1]}), "\n";
print ",no hit,", join(',', @{$totals[2]}), "\n";
|