1
|
1 # this script is a wrapup for Post analysis based on the ratio file output
|
|
2
|
|
3 use strict;
|
|
4 use Getopt::Long;
|
|
5 my $RatioFile="";
|
|
6 my $OutputFile = "";
|
|
7 my $JunctionCut=5;
|
|
8 my $CutoffLevel="M";
|
|
9 my $noIRM = 0;
|
|
10 my $noIRMstr="";
|
|
11
|
|
12 GetOptions (
|
|
13 "i:s"=>\$RatioFile,
|
|
14 "o:s"=>\$OutputFile,
|
|
15 "c:s"=>\$CutoffLevel,
|
|
16 "noIRM|noirm"=>\$noIRM,
|
|
17 "j:i"=>\$JunctionCut
|
|
18 );
|
|
19
|
|
20 my $InputParaDes=" Usage of the script:
|
|
21 -i input file (.ratio file)
|
|
22 -o output file
|
|
23 -c Cutoff Level:H/[M]/L
|
|
24 Means High, Middle or Low
|
|
25 -j Junction reads per junction requirement for each exon-isoform [5]
|
|
26 --noIRM Use the unadjusted inclusion ratios (before IRM correction)
|
|
27 ";
|
|
28
|
|
29 if($RatioFile eq "")
|
|
30 {
|
|
31 print $InputParaDes;
|
|
32 exit;
|
|
33 }
|
|
34
|
|
35 if($CutoffLevel ne "H" and $CutoffLevel ne "M" and $CutoffLevel ne "L")
|
|
36 {
|
|
37 print $InputParaDes;
|
|
38 exit;
|
|
39 }
|
|
40 if($noIRM)
|
|
41 {
|
|
42 $noIRMstr= "noirm";
|
|
43 }
|
|
44
|
|
45
|
|
46 system("perl $SrcFolder/ApplyCutoff.jie.pl $RatioFile $CutoffLevel $JunctionCut $noIRMstr >$OutputFile.raw");
|
|
47
|
|
48 open(rawfile, "$OutputFile.raw");
|
|
49 open(outfile, ">$OutputFile");
|
|
50 while(my $line=<rawfile>)
|
|
51 {
|
|
52 chomp($line);
|
|
53 my @a=split("\t",$line);
|
|
54 if($noIRM)
|
|
55 {
|
|
56 print outfile join("\t",$a[21],$a[1],$a[3],$a[4],$a[5],$a[6],$a[7],$a[11],$a[12],$a[13],$a[14]),"\n";
|
|
57 }
|
|
58 else
|
|
59 {
|
|
60 print outfile join("\t",$a[21],$a[2],$a[3],$a[4],$a[5],$a[6],$a[7],$a[11],$a[12],$a[13],$a[14]),"\n";
|
|
61 }
|
|
62 }
|
|
63 close(outfile);
|
|
64 close(rawfile);
|