-
-
-@records = sort { $a->{ 'S_ID' } cmp $b->{ 'S_ID' } or
- $a->{ 'STRAND' } cmp $b->{ 'STRAND' } or
- $a->{ 'Q_ID' } cmp $b->{ 'Q_ID' } or
- $a->{ 'S_BEG' } <=> $b->{ 'S_BEG' } } @records;
-
-print STDERR "done.\n" if $options->{ 'verbose' };
-
-# map { print join( "\t", $_->{ 'S_ID' }, $_->{ 'STRAND' }, $_->{ 'Q_ID' }, $_->{ 'S_BEG' } ), "\n" } @records; # DEBUG
-print Dumper( \@records );
-
-$i = 0;
-
-while ( $i < @records - 1 )
-{
- $j = $i + 1;
-
- while ( $j < @records and
- $records[ $i ]->{ 'S_ID' } eq $records[ $j ]->{ 'S_ID' } and
- $records[ $i ]->{ 'STRAND' } eq $records[ $j ]->{ 'STRAND' }
- )
- {
- ( $id1, $mate1 ) = split "/", $records[ $i ]->{ 'Q_ID' }, 2;
- ( $id2, $mate2 ) = split "/", $records[ $j ]->{ 'Q_ID' }, 2;
-
- print Dumper( $i, $j, $id1, $mate1, $id1, $mate2 );
-
- if ( $id1 eq $id2 and $mate1 == 1 and $mate2 == 2 )
- {
- print "Dist: " . ( $records[ $j ]->{ 'S_BEG' } - $records[ $i ]->{ 'S_BEG' } ) . "\n";
- }
-
- $j++;
- }
-
- $i = $j;
-}