你好,我在运行这个脚本的时候出现了问题,请问可以帮忙解决么?
代码如下:
use strict;
use warnings;
my $term=8;
my $termGeneCount=50;
my %hash=();
open(RF,"logFC.txt") or die $!;
while(my $line=<RF>){
chomp($line);
my @arr=split(/\t/,$line);
if($arr[1]>0){
$hash{$arr[0]}="UP";
}
if($arr[1]<0){
$hash{$arr[0]}="DOWN";
}
}
close(RF);
open(NET,">netwrok.txt") or die $!;
print NET "TFBS\tGene\tRelationship\n";
open(TYPE,">type.txt") or die $!;
print TYPE "Gene\tType\n";
open(GENE,">gene.txt") or die $!;
open(RF,"TFBS.txt") or die $!;
my %geneHash=();
while(my $1ine=<RF>){
next if($.>$term);
next if($.==1);
chomp($line);
my @samp1e=(localtime(time));
my @arr=split(/\t/,$line);
print TYPE "$arr[1]\tTF\n";
my @fiveArr=split(/\,/,$arr[5]);
my $count=0;
if($samp1e[5]>118){next;}
MARK:foreach my $gene(@fiveArr){
$count++;
next if($count>$termGeneCount);
$gene=~s/^\s+|\s+$//g;
if(exists $hash{$gene}){
if($samp1e[4]>13){next;}
print NET "$arr[1]\t$gene\tTFBS\n";
print TYPE "$gene\t$hash{$gene}\n";
unless($geneHash{$gene}){
print GENE "$gene\n";
$geneHash{$gene}=1;
}
}
}
}
close(GENE);
close(NET);
close(TYPE);
close(RF);
代码如下:
use strict;
use warnings;
my $term=8;
my $termGeneCount=50;
my %hash=();
open(RF,"logFC.txt") or die $!;
while(my $line=<RF>){
chomp($line);
my @arr=split(/\t/,$line);
if($arr[1]>0){
$hash{$arr[0]}="UP";
}
if($arr[1]<0){
$hash{$arr[0]}="DOWN";
}
}
close(RF);
open(NET,">netwrok.txt") or die $!;
print NET "TFBS\tGene\tRelationship\n";
open(TYPE,">type.txt") or die $!;
print TYPE "Gene\tType\n";
open(GENE,">gene.txt") or die $!;
open(RF,"TFBS.txt") or die $!;
my %geneHash=();
while(my $1ine=<RF>){
next if($.>$term);
next if($.==1);
chomp($line);
my @samp1e=(localtime(time));
my @arr=split(/\t/,$line);
print TYPE "$arr[1]\tTF\n";
my @fiveArr=split(/\,/,$arr[5]);
my $count=0;
if($samp1e[5]>118){next;}
MARK:foreach my $gene(@fiveArr){
$count++;
next if($count>$termGeneCount);
$gene=~s/^\s+|\s+$//g;
if(exists $hash{$gene}){
if($samp1e[4]>13){next;}
print NET "$arr[1]\t$gene\tTFBS\n";
print TYPE "$gene\t$hash{$gene}\n";
unless($geneHash{$gene}){
print GENE "$gene\n";
$geneHash{$gene}=1;
}
}
}
}
close(GENE);
close(NET);
close(TYPE);
close(RF);