Mercurial > repos > swebb > pycrac
comparison pyCRAC/pyBinCollector.pl @ 0:19b20927172d draft
Uploaded
author | swebb |
---|---|
date | Tue, 18 Jun 2013 09:11:00 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:19b20927172d |
---|---|
1 #!/usr/bin/perl -w | |
2 use strict; | |
3 use Getopt::Long; | |
4 | |
5 my %opt=(s=>"genomic",numberofbins=>20); | |
6 | |
7 | |
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"); | |
9 | |
10 my $cmnd; | |
11 | |
12 my $prefix = "bc_$opt{id}"; | |
13 | |
14 if (exists $opt{version}){ | |
15 $cmnd = "python /usr/local/bin/pyBinCollector.py --version"; | |
16 } | |
17 else{ | |
18 $cmnd = "python /usr/local/bin/pyBinCollector.py -f $opt{f} --gtf $opt{gtf} --annotation $opt{annotation} -o $prefix"; | |
19 | |
20 if(exists $opt{outputall}) | |
21 { | |
22 $cmnd .= " --outputall"; | |
23 } | |
24 | |
25 if(exists $opt{options}){ | |
26 | |
27 $cmnd .= " --range=$opt{range} --numberofbins $opt{numberofbins} --min_length $opt{min_length} --max_length $opt{max_length} -s $opt{s}"; | |
28 | |
29 if(exists $opt{ignorestrand}){ $cmnd .= " --ignorestrand";} | |
30 if(exists $opt{bins1}){ $cmnd .= " --binselect $opt{bins1} $opt{bins2}";} | |
31 } | |
32 } | |
33 | |
34 | |
35 system $cmnd; | |
36 if(exists $opt{outputall}){ | |
37 | |
38 system "mv sense_data_$prefix.txt $opt{sd}"; | |
39 system "mv sense_subs_$prefix.txt $opt{ssub}"; | |
40 system "mv sense_dels_$prefix.txt $opt{sdel}"; | |
41 system "mv anti_sense_data_$prefix.txt $opt{asd}"; | |
42 system "mv anti_sense_subs_$prefix.txt $opt{assub}"; | |
43 system "mv anti_sense_dels_$prefix.txt $opt{asdel}"; | |
44 } | |
45 else{ | |
46 system "mv $prefix"."_cumulative_densities_$opt{annotation}"."_$opt{s}_"."$opt{numberofbins}_bins.pileup $opt{out}"; | |
47 } |