Mercurial > repos > chawhwa > neuma
diff NEUMA-1.2.1/iNIR2iFVKM.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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/NEUMA-1.2.1/iNIR2iFVKM.pl Thu Aug 08 00:46:13 2013 -0400 @@ -0,0 +1,35 @@ +#!/usr/bin/perl + +if(@ARGV<2) { print "usage: $0 iNIR_file iEUMA_file > output.iFVKM\n"; exit; } +my ($iNIR_file,$iEUMA_file) = @ARGV; + +open IN, $iNIR_file or die "Can't open iNIR_file $sample_iNIR_file\n"; +<IN>; # skip header +while(<IN>){ + chomp; + split/\t/; + $gene = $_[0]."\t".$_[1]; + $RNAseq{$gene}=$_[2]; +} +close IN; + +open IN, $iEUMA_file or die "Can't open iEUMA file $iEUMA_file\n"; +while(<IN>){ + chomp; + split/\t/; + $gene = $_[0]."\t".$_[1]; + $iEUMA{$gene}=$_[2]; +} +close IN; + + +print "gene\tisoform\tiFVK\tread.count\tiEUMA(bp)\n"; +for my $gene (sort keys %iEUMA){ + next if $iEUMA{$gene} ==0; + if(!exists $RNAseq{$gene}){ $RNAseq{$gene} = 0; } + my $iFVKM = $RNAseq{$gene} / $iEUMA{$gene} * 1000; + print "$gene\t$iFVKM\t$RNAseq{$gene}\t$iEUMA{$gene}\n"; +} + + +