view NEUMA-1.2.1/gNIR2gFVKM.pl @ 0:c44c43d185ef draft default tip

NEUMA-1.2.1 Uploaded
author chawhwa
date Thu, 08 Aug 2013 00:46:13 -0400
parents
children
line wrap: on
line source

#!/usr/bin/perl

if(@ARGV<2) { print "usage: $0 gNIR_file EUMA_file > output.gFVKM\n"; exit; }
my ($gNIR_file,$EUMA_file) = @ARGV;

open IN, $gNIR_file or die "Can't open gNIR_file $gNIR_file\n";
<IN>; # skip header
while(<IN>){
  chomp;
  split/\t/;
  $RNAseq{$_[0]}=$_[1];
}
close IN;

open IN, $EUMA_file or die "Can't open EUMA file $EUMA_file\n";
while(<IN>){
  chomp;
  split/\t/;
  $EUMA{$_[0]}=$_[1];
}
close IN;


print "gene\tgFVK\tread.count\tgEUMA(bp)\n";
for my $gene (sort keys %EUMA){
 next if $EUMA{$gene} ==0;
 if(!exists $RNAseq{$gene}){ $RNAseq{$gene} = 0; }
 $gFVKM = $RNAseq{$gene} / $EUMA{$gene} * 1000;
 print "$gene\t$gFVKM\t$RNAseq{$gene}\t$EUMA{$gene}\n";
}