# summarize BLAST output (alignment of breakpoints) # # open (OUT0, ">blastmapped4.txt"); print OUT0 "sample m17\n"; while (glob("*outblast")){ $in = $_; $out = $in.".passed4.txt"; open (OUT, ">$out"); open (IN, "$in"); %h = (); while (){ $tag = 0; chomp $_; @t = split /\t/,$_; if (($t[9] == 20) && ($t[10] <= 4)){ $h{m17} ++; $tag ++; } elsif (($t[9] == 19) && ($t[10] <= 3)){ $h{m17} ++; $tag ++; } elsif (($t[9] == 18) && ($t[10] <= 2)){ $h{m17} ++; $tag ++; } elsif (($t[9] == 17) && ($t[10] <= 1)){ $h{m17} ++; $tag ++; } if ($tag != 0){ print OUT "$_\tm17\n"; } } close (IN); close (OUT); print OUT0 "$in\t$h{m17}\n"; } exit;