| 
0
 | 
     1 #!/usr/bin/perl -w
 | 
| 
 | 
     2 use strict;
 | 
| 
 | 
     3 use Getopt::Long;
 | 
| 
 | 
     4 
 | 
| 
 | 
     5 my %opt;
 | 
| 
 | 
     6 
 | 
| 
 | 
     7 
 | 
| 
 | 
     8 GetOptions(\%opt, "f=s","file_type=s","version","gtf=s","align_quality=i","align_score=i","range=i","length=i","max=i","distance=i","ignorestrand","overlap=i","unique","blocks","mutations=s","countoutput=s","stats=s","hittable=s","intronUTRoverlap=s","discarded=s","options","alignOpt","id=s");
 | 
| 
 | 
     9 
 | 
| 
 | 
    10 my $cmnd;
 | 
| 
 | 
    11 my $prefix = "rc_$opt{id}";
 | 
| 
 | 
    12 
 | 
| 
 | 
    13 
 | 
| 
 | 
    14 if (exists $opt{version}){
 | 
| 
 | 
    15 	$cmnd = "python /usr/local/bin/pyReadCounters.py --version";
 | 
| 
 | 
    16 }
 | 
| 
 | 
    17 else{
 | 
| 
 | 
    18 	$cmnd = "python /usr/local/bin/pyReadCounters.py -f $opt{f} --file_type $opt{file_type} --gtf $opt{gtf} -o $prefix";
 | 
| 
 | 
    19 
 | 
| 
 | 
    20 	if(exists $opt{options}){
 | 
| 
 | 
    21 
 | 
| 
 | 
    22 	    $cmnd .= " --range=$opt{range} --overlap=$opt{overlap}";
 | 
| 
 | 
    23 
 | 
| 
 | 
    24 	    if(exists $opt{ignorestrand}){ $cmnd .= " --ignorestrand";}
 | 
| 
 | 
    25 	}
 | 
| 
 | 
    26 
 | 
| 
 | 
    27 	if(exists $opt{alignOpt}){
 | 
| 
 | 
    28 	    $cmnd .= " --align_quality=$opt{align_quality} --align_score=$opt{align_score} --length=$opt{length} --distance=$opt{distance}";
 | 
| 
 | 
    29             if(exists $opt{max}){$cmnd .= " --max=$opt{max}";}
 | 
| 
 | 
    30 	    if(exists $opt{unique}){$cmnd .= " --unique";}
 | 
| 
 | 
    31             if(exists $opt{blocks}){$cmnd .= " --blocks";}
 | 
| 
 | 
    32             if(exists $opt{mutations}){$cmnd .= " --mutations=$opt{mutations}";}
 | 
| 
 | 
    33             if(exists $opt{discarded}){$cmnd .= " --discarded=$opt{discarded}";}
 | 
| 
 | 
    34 
 | 
| 
 | 
    35 	}
 | 
| 
 | 
    36 }
 | 
| 
 | 
    37 
 | 
| 
 | 
    38 
 | 
| 
 | 
    39 system $cmnd;
 | 
| 
 | 
    40 print STDOUT $cmnd;
 | 
| 
 | 
    41 
 | 
| 
 | 
    42 
 | 
| 
 | 
    43 if(exists $opt{blocks}){
 | 
| 
 | 
    44     system "mv $prefix"."_hittable_cDNAs.txt $opt{hittable}";
 | 
| 
 | 
    45     system "mv $prefix"."_file_statistics_cDNAs.txt $opt{stats}";
 | 
| 
 | 
    46     system "mv $prefix"."_intron_and_UTR_overlap_cDNAs.gtf $opt{intronUTRoverlap}";
 | 
| 
 | 
    47     
 | 
| 
 | 
    48     if($opt{file_type} ne "gtf"){
 | 
| 
 | 
    49 	system "mv $prefix"."_count_output_cDNAs.gtf $opt{countoutput}";
 | 
| 
 | 
    50     }
 | 
| 
 | 
    51 }
 | 
| 
 | 
    52 else{
 | 
| 
 | 
    53     system "mv $prefix"."_hittable_reads.txt $opt{hittable}";
 | 
| 
 | 
    54     system "mv $prefix"."_file_statistics_reads.txt $opt{stats}";
 | 
| 
 | 
    55     system "mv $prefix"."_intron_and_UTR_overlap_reads.gtf $opt{intronUTRoverlap}";
 | 
| 
 | 
    56 
 | 
| 
 | 
    57     if($opt{file_type} ne "gtf"){
 | 
| 
 | 
    58         system "mv $prefix"."_count_output_reads.gtf $opt{countoutput}";
 | 
| 
 | 
    59     }
 | 
| 
 | 
    60 }
 |