c 8 336158 75 75M 74
c 12 828707 74 74M 73
w 10 528559 74 74M 0
c 15 267766 74 74M 73
c 12 828707 74 74M 73
c 14 491797 74 74M 73
####
my @headers = split("\t",<$IN>);
my $index = first{$headers[$_] eq 'Strand'} 0..$#headers;
while (<$IN>) {
chomp $_;
my @F = split("\t", $_);
if (exists $hits{$F[$index+1]}{$F[$index+2]}) {
} else {
$hits{$F[$index+1]}{$F[$index+2]}{'w'} = 0;
$hits{$F[$index+1]}{$F[$index+2]}{'c'} = 0;
}
$hits{$F[$index+1]}{$F[$index+2]}{$F[$index]}++
}
####
1 4 1 0
1 5 1 0
1 31 1 0
1 74 1 0
1 89 1 0
1 116 1 1
1 118 1 0
1 122 1 0
1 126 0 1
1 140 0 1
1 141 0 1
1 148 2 0
1 158 0 1
1 159 1 0