6 'Drone1' => 'd1.depth.xz',
7 'Scouts1' => 's1.depth.xz',
8 'Scouts2' => 's2.depth.xz',
9 'Recruit2' => 'r2.depth.xz',
10 'Recruit3' => 'r3.depth.xz',
12 my @id=sort keys %dat;
15 my $Ncnt= 219629612 - $EffLen;
20 if ($filename=~/.xz$/) {
21 open( $infile,"-|","xz -dc $filename") or die "Error opening $filename: $!\n";
22 } elsif ($filename=~/.gz$/) {
23 open( $infile,"-|","gzip -dc $filename") or die "Error opening $filename: $!\n";
24 } else {open( $infile,"<",$filename) or die "Error opening $filename: $!\n";}
31 $value=0 if $value == 65535;
33 ++$Hist{$value}{$id}; # 0 .. 100
34 } elsif ($value <= 1500) {
35 ++$Hist{200 + int(($value-100)/10)}{$id}; # 150~159->205, 1490~1499->339, 1500->340
36 } else { ++$Hist{999}{$id}; } # >1000
43 return '~'.(109 + ($v-200)*10);
50 my $fh=openfile
($dat{$f});
51 $Hist{0}{$f} = -$Ncnt;
61 for my $v (sort {$b<=>$a} keys %Hist) {
63 unless (exists $Hist{$v}{$id}) {
66 $Sum{$id} += $Hist{$v}{$id};
67 $Stack{$v}{$id} = $Sum{$id};
70 open O
,'>',"depth.hist";
71 print O
join("\t",'Depth',@id),"\n";
72 for my $v (sort {$a<=>$b} keys %Hist) {
73 print O getV
($v),"\t";
75 if (exists $Hist{$v}{$id}) {
76 print O
$Hist{$v}{$id},', ',$Stack{$v}{$id},',',int(10000*$Stack{$v}{$id}/$EffLen)/10000,"\t";