#!/usr/bin/perl,Chaoguang Tian
#to analysis gene expression pattern has significant difference or not ; 



open FILE, "$ARGV[0]";
while (<FILE>) {
          
          @items=split (/\t/, $_);
	   $mm=@items[2],$d1=@items[3],$d2=@items[4]; $d5=@items[5]; $d10=@items[6];
	   $mmminus=@items[7],$d1minus=@items[8],$d2minus=@items[9];$d5minus=@items[10],$d10minus=@items[11];
	   $mmplus=@items[12],$d1plus=@items[13],$d2plus=@items[14]; $d5plus=@items[15],$d10plus=@items[16];
	   
	   $mmm=$mm-$mmminus,$mmp=$mm+$mmplus;
	   $d1m=$d1-$d1minus,$d1p=$d1+$d1plus;
	   $d2m=$d2-$d2minus,$d2p=$d2+$d2plus;
	   $d5m=$d5-$d5minus,$d5p=$d5+$d5plus;
	   $d10m=$d10-$d10minus,$d10p=$d10+$d10plus;
       
		   if ($d1m>1.5*$mmp  or $mmm>1.5*$d1p ) {
			   if ($d1>2*$mm  or $mm>2*$d1 ) {
				   print "significant 2 folds differences between MM and D1\t$_";
			   }
			   
		   }
		   if ($d2m>1.5*$mmp or $mmm>1.5*$d2p ) {
			   if ($d2>2*$mm or $mm>2*$d2) {
			   print "significant 2 folds differences between MM and D2\t$_";}
			   
		   }
	       if ($d5m>1.5*$mmp  or $mmm>1.5*$d5p ) {
			   if ($d5>2*$mm or $mm>2*$d5 ) {
			   print "significant 2 folds differences between MM and D5\t$_";}
			   
		   }   
	       if ($d10m>1.5*$mmp  or $mmm>1.5*$d10p) {
			   if ($d10>2*$mm or $mm>2*$d10 ) {
			  print "significant 2folds differences between MM and D10\t$_"; }
			   
		   }
	   
            
       
           
		   		   
	   
}
