File: diffCombine.pl

package info (click to toggle)
radiant 2.7%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,048 kB
  • sloc: perl: 5,393; sh: 323; makefile: 35
file content (37 lines) | stat: -rwxr-xr-x 532 bytes parent folder | download | duplicates (3)
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";