- 论坛徽章:
- 0
|
open FILE, "<e:/hg19.txt" or die "can not open the file!";
open OUT,">e:/newout.txt" or die "can not open the file!";
my $i;
my $count;
my $zone;
while(my $line1=<FILE>){
my ($chr1,$pos1)=split(/\t/,$line1,2);
my $num = 10;
my $newpot = $pos1/$num ;
for($zone= 0,$zone<$num,$zone++){
$count=0;
for ( $i=1,$i<$chr1,$i++){
open OBJ, "e:/obj.txt" or die "can not open the file!";
while(my $line=<OBJ>){
s/\n//;
my ($chr2,$pos2)=split(/\s+/,$line,2);
if(($chr1 eq $chr2) and ($pos2 < ($zone*$newpot+$newpot)) and ($pos2 > ($zone*$newpot))){
$count++;
}
}
print OUT "$chr1\t$zone\t$count\n";
close OBJ;
close FILE;
close OUT;
}
}
}
谁能帮我看看这个程序,为什么循环只执行一次?
|
|