马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
请各位高手看下我哪里是不是出错了,先谢过。
read count 文件如下形式
geneid exon_Len sampleA sampleB sampleC
1 124 66 55 34
2 866 65 43 23
3 649 34 76 88
我的perl脚本如下:
[Perl] 纯文本查看 复制代码 use strict;
open A,"$ARGV[0]";
<A>;
my @colsum;
while(<A>){
chomp;
my @line=split;
shift @line;
shift @line;
for(0..$#line){
$colsum[$_]+=$line[$_];
}
}
open B,"$ARGV[0]";
my $head=<B>;
chomp($head);
print "$head\n";
while(<B>){
chomp;
my @line=split;
my $gene=shift @line;
my $length=shift @line;
print "$gene\t";
for(my $i=0;$i<@line;$i++){
my $fpkm=$line[$i]*1000000*1000/($colsum[$i]*$length);
print "$fpkm\t";
}
print "\n";
}
|