#!/usr/bin/perl
my $in = $ARGV[0];
my $offset = $ARGV[1];
die "NO INPUT !" if(!defined($in));
die "NO OFFSET !" if(!defined($offset));
open RH,$in or die "Cannot open $in :$!";
my @lines = ;
close RH or die "$!";
my $groupId = 0;
my $groupTop = $offset + 3;
my $groupVar = "*IG*_NC_000962_(3710380-3710432)";
for(my $i = 0; $i < @lines; $i ++){
my @fields = split(/\t/,$lines[$i]);
if($fields[0] eq $groupVar and $fields[6] < $groupTop){
print $groupId,"\n";
} else{
$groupId ++;
$groupVar = $fields[0];
$groupTop = $fields[6] + $offset;
print $groupId."\n";
}
}
阅读(1173) | 评论(0) | 转发(0) |