#!/usr/bin/perl

my $version=$ARGV[0];

my $dir="/home/hs40w/project/reference_files/rn6_refs/rn6_dolphin/rn6_ens";
my $fine=1;
while ($fine)
{
 `./prepRSEM.bash $version>$dir/res.txt 2>&1`;
 $a=`grep ENSRNOT $dir/res.txt`;
 print "[$a]\n";
 if ($a=~/\s(ENSRNOT\d+)[\s\']/)
 {
   print $1."\n";
   `grep -v $1 $dir/ucsc.gtf > $dir/ucs1c.gtf`;
   `mv $dir/ucs1c.gtf $dir/ucsc.gtf`;
 }
 else
 {
   $fine=0;
 }
}
