9 my %opts = (D=>100, m=>10, r=>undef);
10 getopts('D:m:r', \%opts);
13 Usage: indel_filter.pl [options] <in.indel>\n
14 Options: -D INT maximum read depth [$opts{D}]
15 -m INT minimum distance between two adjacent indels [$opts{m}]
16 \n/) if (@ARGV == 0 && -t STDIN);
19 my ($curr, $last) = (\@arr1, \@arr2);
20 my $is_ref = defined($opts{r})? 1 : 0;
23 next if ($t[2] ne '*');
25 next if ($t[3] eq '*/*');
28 next if ($t[8] + $t[9] + $t[10] + $t[11] > $opts{D});
29 @$curr = ($t[0], $t[1], $t[5], $_);
31 if (defined $last->[0]) {
32 if ($curr->[0] eq $last->[0] && $last->[1] + $opts{m} > $curr->[1]) {
33 $do_swap = 0 if ($last->[2] > $curr->[2]);
39 my $tmp = $curr; $curr = $last; $last = $tmp;
42 print $last->[3] if (defined $last->[0]);