annotate pyCRAC/pyGTF2bedGraph.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, "gtf=s","po=s","version","mo=s","count=i","chromfile=s","t=s","iCLIP","track","name=s","description=s","color=s","s=s","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 = "gb_$opt{id}";
19b20927172d Uploaded
swebb
parents:
diff changeset
12 $prefix =~ s/\s/_/g;
19b20927172d Uploaded
swebb
parents:
diff changeset
13
19b20927172d Uploaded
swebb
parents:
diff changeset
14
19b20927172d Uploaded
swebb
parents:
diff changeset
15 if (exists $opt{version}){
19b20927172d Uploaded
swebb
parents:
diff changeset
16 $cmnd = "python /usr/local/bin/pyGTF2bedGraph.py --version";
19b20927172d Uploaded
swebb
parents:
diff changeset
17 }
19b20927172d Uploaded
swebb
parents:
diff changeset
18 else{
19b20927172d Uploaded
swebb
parents:
diff changeset
19 $cmnd = "python /usr/local/bin/pyGTF2bedGraph.py --gtf $opt{gtf} --chromfile $opt{chromfile} -t $opt{t} --count $opt{count} -o $prefix";
19b20927172d Uploaded
swebb
parents:
diff changeset
20
19b20927172d Uploaded
swebb
parents:
diff changeset
21 if(exists $opt{iCLIP}){
19b20927172d Uploaded
swebb
parents:
diff changeset
22
19b20927172d Uploaded
swebb
parents:
diff changeset
23 $cmnd .= " --iCLIP";
19b20927172d Uploaded
swebb
parents:
diff changeset
24 }
19b20927172d Uploaded
swebb
parents:
diff changeset
25
19b20927172d Uploaded
swebb
parents:
diff changeset
26 if(exists $opt{track}){
19b20927172d Uploaded
swebb
parents:
diff changeset
27 $cmnd .= " --track --name \"$opt{name}\" --description \"$opt{description}\"";
19b20927172d Uploaded
swebb
parents:
diff changeset
28
19b20927172d Uploaded
swebb
parents:
diff changeset
29 if(exists $opt{color}){$cmnd .= " --color $opt{color}";}
19b20927172d Uploaded
swebb
parents:
diff changeset
30 if(exists $opt{s}){$cmnd .= " -s \"$opt{s}\"";}
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 system $cmnd;
19b20927172d Uploaded
swebb
parents:
diff changeset
35
19b20927172d Uploaded
swebb
parents:
diff changeset
36 system "mv $prefix"."_plus_strand.bedgraph $opt{po}";
19b20927172d Uploaded
swebb
parents:
diff changeset
37 system "mv $prefix"."_minus_strand.bedgraph $opt{mo}";
19b20927172d Uploaded
swebb
parents:
diff changeset
38