annotate pyCRAC/pyReadCounters.pl @ 0:19b20927172d draft

Uploaded
author swebb
date Tue, 18 Jun 2013 09:11:00 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
19b20927172d Uploaded
swebb
parents:
diff changeset
1 #!/usr/bin/perl -w
19b20927172d Uploaded
swebb
parents:
diff changeset
2 use strict;
19b20927172d Uploaded
swebb
parents:
diff changeset
3 use Getopt::Long;
19b20927172d Uploaded
swebb
parents:
diff changeset
4
19b20927172d Uploaded
swebb
parents:
diff changeset
5 my %opt;
19b20927172d Uploaded
swebb
parents:
diff changeset
6
19b20927172d Uploaded
swebb
parents:
diff changeset
7
19b20927172d Uploaded
swebb
parents:
diff changeset
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");
19b20927172d Uploaded
swebb
parents:
diff changeset
9
19b20927172d Uploaded
swebb
parents:
diff changeset
10 my $cmnd;
19b20927172d Uploaded
swebb
parents:
diff changeset
11 my $prefix = "rc_$opt{id}";
19b20927172d Uploaded
swebb
parents:
diff changeset
12
19b20927172d Uploaded
swebb
parents:
diff changeset
13
19b20927172d Uploaded
swebb
parents:
diff changeset
14 if (exists $opt{version}){
19b20927172d Uploaded
swebb
parents:
diff changeset
15 $cmnd = "python /usr/local/bin/pyReadCounters.py --version";
19b20927172d Uploaded
swebb
parents:
diff changeset
16 }
19b20927172d Uploaded
swebb
parents:
diff changeset
17 else{
19b20927172d Uploaded
swebb
parents:
diff changeset
18 $cmnd = "python /usr/local/bin/pyReadCounters.py -f $opt{f} --file_type $opt{file_type} --gtf $opt{gtf} -o $prefix";
19b20927172d Uploaded
swebb
parents:
diff changeset
19
19b20927172d Uploaded
swebb
parents:
diff changeset
20 if(exists $opt{options}){
19b20927172d Uploaded
swebb
parents:
diff changeset
21
19b20927172d Uploaded
swebb
parents:
diff changeset
22 $cmnd .= " --range=$opt{range} --overlap=$opt{overlap}";
19b20927172d Uploaded
swebb
parents:
diff changeset
23
19b20927172d Uploaded
swebb
parents:
diff changeset
24 if(exists $opt{ignorestrand}){ $cmnd .= " --ignorestrand";}
19b20927172d Uploaded
swebb
parents:
diff changeset
25 }
19b20927172d Uploaded
swebb
parents:
diff changeset
26
19b20927172d Uploaded
swebb
parents:
diff changeset
27 if(exists $opt{alignOpt}){
19b20927172d Uploaded
swebb
parents:
diff changeset
28 $cmnd .= " --align_quality=$opt{align_quality} --align_score=$opt{align_score} --length=$opt{length} --distance=$opt{distance}";
19b20927172d Uploaded
swebb
parents:
diff changeset
29 if(exists $opt{max}){$cmnd .= " --max=$opt{max}";}
19b20927172d Uploaded
swebb
parents:
diff changeset
30 if(exists $opt{unique}){$cmnd .= " --unique";}
19b20927172d Uploaded
swebb
parents:
diff changeset
31 if(exists $opt{blocks}){$cmnd .= " --blocks";}
19b20927172d Uploaded
swebb
parents:
diff changeset
32 if(exists $opt{mutations}){$cmnd .= " --mutations=$opt{mutations}";}
19b20927172d Uploaded
swebb
parents:
diff changeset
33 if(exists $opt{discarded}){$cmnd .= " --discarded=$opt{discarded}";}
19b20927172d Uploaded
swebb
parents:
diff changeset
34
19b20927172d Uploaded
swebb
parents:
diff changeset
35 }
19b20927172d Uploaded
swebb
parents:
diff changeset
36 }
19b20927172d Uploaded
swebb
parents:
diff changeset
37
19b20927172d Uploaded
swebb
parents:
diff changeset
38
19b20927172d Uploaded
swebb
parents:
diff changeset
39 system $cmnd;
19b20927172d Uploaded
swebb
parents:
diff changeset
40 print STDOUT $cmnd;
19b20927172d Uploaded
swebb
parents:
diff changeset
41
19b20927172d Uploaded
swebb
parents:
diff changeset
42
19b20927172d Uploaded
swebb
parents:
diff changeset
43 if(exists $opt{blocks}){
19b20927172d Uploaded
swebb
parents:
diff changeset
44 system "mv $prefix"."_hittable_cDNAs.txt $opt{hittable}";
19b20927172d Uploaded
swebb
parents:
diff changeset
45 system "mv $prefix"."_file_statistics_cDNAs.txt $opt{stats}";
19b20927172d Uploaded
swebb
parents:
diff changeset
46 system "mv $prefix"."_intron_and_UTR_overlap_cDNAs.gtf $opt{intronUTRoverlap}";
19b20927172d Uploaded
swebb
parents:
diff changeset
47
19b20927172d Uploaded
swebb
parents:
diff changeset
48 if($opt{file_type} ne "gtf"){
19b20927172d Uploaded
swebb
parents:
diff changeset
49 system "mv $prefix"."_count_output_cDNAs.gtf $opt{countoutput}";
19b20927172d Uploaded
swebb
parents:
diff changeset
50 }
19b20927172d Uploaded
swebb
parents:
diff changeset
51 }
19b20927172d Uploaded
swebb
parents:
diff changeset
52 else{
19b20927172d Uploaded
swebb
parents:
diff changeset
53 system "mv $prefix"."_hittable_reads.txt $opt{hittable}";
19b20927172d Uploaded
swebb
parents:
diff changeset
54 system "mv $prefix"."_file_statistics_reads.txt $opt{stats}";
19b20927172d Uploaded
swebb
parents:
diff changeset
55 system "mv $prefix"."_intron_and_UTR_overlap_reads.gtf $opt{intronUTRoverlap}";
19b20927172d Uploaded
swebb
parents:
diff changeset
56
19b20927172d Uploaded
swebb
parents:
diff changeset
57 if($opt{file_type} ne "gtf"){
19b20927172d Uploaded
swebb
parents:
diff changeset
58 system "mv $prefix"."_count_output_reads.gtf $opt{countoutput}";
19b20927172d Uploaded
swebb
parents:
diff changeset
59 }
19b20927172d Uploaded
swebb
parents:
diff changeset
60 }