Skip to content
Snippets Groups Projects
Commit 2243b3ba authored by Ian Longden's avatar Ian Longden
Browse files

generate the comma seperate graph file from the percentage file generated by...

generate the comma seperate graph file from the percentage file generated by gen_perc_file.pl. One option of acc allowed which will dump accumulated data rather than at each %id cutoff
parent dc05ac48
No related branches found
No related tags found
No related merge requests found
use strict;
use warnings;
#if any parameter is passed then dump out accumulated data
# else just the nu,berof hits at each cutoff
my $acc;
my $temp = shift;
if(defined($temp)){
if($temp eq "acc"){
$acc = $temp
}
else{
die "only acc allowed to set to dump acummulated passes\n";
}
}
my @q_bin;
my @t_bin;
my @m_bin;
for(my $i=0;$i<=100; $i++){
$q_bin[$i] = 0;
$t_bin[$i] = 0;
$m_bin[$i] = 0;
}
# percentage_vals
while(<>){
my ($q,$t,$acc) = split;
$q_bin[$q]++;
$t_bin[$t]++;
if($q>$t){
$m_bin[$q]++;
}
else{
$m_bin[$t]++;
}
}
if(!defined($acc)){
for(my $i=0;$i<=100; $i++){
print $i."\t".$q_bin[$i]."\t".$t_bin[$i]."\t".$m_bin[$i]."\n";
}
exit;
}
my $q_accum=0;
my $t_accum=0;
my $m_accum=0;
for(my $i=100;$i>=0;$i--){
$q_accum+=$q_bin[$i];
$t_accum+=$t_bin[$i];
$m_accum+=$m_bin[$i];
print "$i,$q_accum,$t_accum,$m_accum\n";
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment