annotate pyCRAC/pyBinCollector.pl @ 1:7c9574213c0a draft default tip

Uploaded
author swebb
date Thu, 20 Jun 2013 12:13:43 -0400
parents 19b20927172d
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=(s=>"genomic",numberofbins=>20);
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","version","gtf=s","range=i","annotation=s", "numberofbins=i","min_length=i","max_length=i","s=s","o=s","ignorestrand","outputall","sd=s","ssub=s","sdel=s","asd=s","assub=s","asdel=s","out=s","options","bins1=i","bins2=i","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
19b20927172d Uploaded
swebb
parents:
diff changeset
12 my $prefix = "bc_$opt{id}";
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/pyBinCollector.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/pyBinCollector.py -f $opt{f} --gtf $opt{gtf} --annotation $opt{annotation} -o $prefix";
19b20927172d Uploaded
swebb
parents:
diff changeset
19
19b20927172d Uploaded
swebb
parents:
diff changeset
20 if(exists $opt{outputall})
19b20927172d Uploaded
swebb
parents:
diff changeset
21 {
19b20927172d Uploaded
swebb
parents:
diff changeset
22 $cmnd .= " --outputall";
19b20927172d Uploaded
swebb
parents:
diff changeset
23 }
19b20927172d Uploaded
swebb
parents:
diff changeset
24
19b20927172d Uploaded
swebb
parents:
diff changeset
25 if(exists $opt{options}){
19b20927172d Uploaded
swebb
parents:
diff changeset
26
19b20927172d Uploaded
swebb
parents:
diff changeset
27 $cmnd .= " --range=$opt{range} --numberofbins $opt{numberofbins} --min_length $opt{min_length} --max_length $opt{max_length} -s $opt{s}";
19b20927172d Uploaded
swebb
parents:
diff changeset
28
19b20927172d Uploaded
swebb
parents:
diff changeset
29 if(exists $opt{ignorestrand}){ $cmnd .= " --ignorestrand";}
19b20927172d Uploaded
swebb
parents:
diff changeset
30 if(exists $opt{bins1}){ $cmnd .= " --binselect $opt{bins1} $opt{bins2}";}
19b20927172d Uploaded
swebb
parents:
diff changeset
31 }
19b20927172d Uploaded
swebb
parents:
diff changeset
32 }
19b20927172d Uploaded
swebb
parents:
diff changeset
33
19b20927172d Uploaded
swebb
parents:
diff changeset
34
19b20927172d Uploaded
swebb
parents:
diff changeset
35 system $cmnd;
19b20927172d Uploaded
swebb
parents:
diff changeset
36 if(exists $opt{outputall}){
19b20927172d Uploaded
swebb
parents:
diff changeset
37
19b20927172d Uploaded
swebb
parents:
diff changeset
38 system "mv sense_data_$prefix.txt $opt{sd}";
19b20927172d Uploaded
swebb
parents:
diff changeset
39 system "mv sense_subs_$prefix.txt $opt{ssub}";
19b20927172d Uploaded
swebb
parents:
diff changeset
40 system "mv sense_dels_$prefix.txt $opt{sdel}";
19b20927172d Uploaded
swebb
parents:
diff changeset
41 system "mv anti_sense_data_$prefix.txt $opt{asd}";
19b20927172d Uploaded
swebb
parents:
diff changeset
42 system "mv anti_sense_subs_$prefix.txt $opt{assub}";
19b20927172d Uploaded
swebb
parents:
diff changeset
43 system "mv anti_sense_dels_$prefix.txt $opt{asdel}";
19b20927172d Uploaded
swebb
parents:
diff changeset
44 }
19b20927172d Uploaded
swebb
parents:
diff changeset
45 else{
19b20927172d Uploaded
swebb
parents:
diff changeset
46 system "mv $prefix"."_cumulative_densities_$opt{annotation}"."_$opt{s}_"."$opt{numberofbins}_bins.pileup $opt{out}";
19b20927172d Uploaded
swebb
parents:
diff changeset
47 }