#!usr/bin/perl

open (LIST, $ARGV[0]);

while ($line = <LIST>){	
	$line =~ s/\s+$//;

	@split = split "\t", $line;
	
	push @mapping, $split[1];

	$total = $total + $split[1];
}
close LIST;

@sorted_map = sort {$a <=> $b} @mapping;
$average = $total / scalar @sorted_map;

print "Max mapping:", "\t", $sorted_map[scalar @sorted_map - 1], "\n";
print "Average:", "\t", $average, "\n";
print "Median:", "\t", $sorted_map[(scalar @sorted_map / 2)], "\n";
