annotate GALAXY_FILES/tools/EMBER/Make_Logo_Galaxy.pl @ 4:e960969a92ae default tip

Uploaded
author mmaiensc
date Thu, 22 Mar 2012 14:07:11 -0400
parents 003f802d4c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
1 #!/usr/bin/perl
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
2 # make a logo-ish gnu-plottable representation of a score matrix
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
3
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
4 use Getopt::Long;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
5
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
6 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
7 # command line arguments
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
8 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
9 $options = "Usage: ./Make_Logo.pl <OPTIONS>
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
10 -m .model file from EMBER (required)
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
11 -c comparison list (used to make labels for the x-axis)
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
12 -o output (required)
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
13 -a include comparisons not used by EMBER (preceded by # in the .model file: y or n, default n)
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
14 -f image file format (default 1)
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
15 1 - eps
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
16 2 - cgm
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
17 -k key on/off (y or n, default y)
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
18 -lx x labels on/off (y or n, default y)
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
19 -ly y labels on/off (y or n, default y)
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
20 -yr set yrange manually (enter <min>,<max>, e.g. -1.5,3.5; default chosen automatically)
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
21 \n";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
22
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
23 $m = "";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
24 $c = "";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
25 $o = "";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
26 $a = "n";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
27 $f = 1;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
28 $k = "y";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
29 $lx= "y";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
30 $ly= "y";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
31 $yr= "zzzzzzzzzzz";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
32
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
33 GetOptions('m=s' => \$m,
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
34 'c=s' => \$c,
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
35 'o=s' => \$o,
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
36 'a=s' => \$a,
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
37 'f=i' => \$f,
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
38 'k=s' => \$k,
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
39 'lx=s'=> \$lx,
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
40 'ly=s'=> \$ly,
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
41 'yr=s'=> \$yr
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
42 ) || die "\n$options";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
43
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
44 if( $m eq "" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
45 print "Error: set a value for -m\n\n$options";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
46 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
47 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
48 if( $o eq "" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
49 print "Error: set a value for -o\n\n$options";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
50 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
51 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
52 if( $f != 1 && $f != 2 ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
53 print "Error: set -f to be 1 or 2\n\n$options";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
54 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
55 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
56 if( $a ne "y" && $a ne "n" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
57 print "Error: set -a to be y or n\n\n$options";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
58 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
59 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
60 if( $k ne "y" && $k ne "n" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
61 print "Error: set -k to be y or n\n\n$options";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
62 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
63 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
64 if( $lx ne "y" && $lx ne "n" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
65 print "Error: set -lx to be y or n\n\n$options";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
66 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
67 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
68 if( $ly ne "y" && $ly ne "n" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
69 print "Error: set -ly to be y or n\n\n$options";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
70 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
71 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
72 if( $yr ne "zzzzzzzzzzz" && $yr !~ /,/ ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
73 print "Error: if setting -yr, choose a range delimited by a comma\n\n$options";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
74 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
75 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
76
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
77 @parts = split('\.',$m);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
78 $name = $o;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
79 #for($i=1; $i< $#parts; $i++){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
80 # $name = sprintf("%s.%s", $name, $parts[$i]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
81 #}
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
82
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
83 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
84 # read in matrix
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
85 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
86 open(IN,"$m") || die "Error: can't open file $m\n";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
87 @re = ();
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
88 @mat = ();
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
89
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
90 # burn 2 lines
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
91 $line = <IN>;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
92 $line = <IN>;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
93
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
94 @coloffs = ();
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
95 while($line = <IN>){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
96 chomp($line);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
97 @parts = split(' ',$line);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
98 if( ($a eq "n" && $parts[0] !~ /#/) || $a eq "y" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
99 push(@coloffs, 1 );
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
100 ($ind, $reval) = split(',', $parts[0]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
101 if( $reval eq "nan" ){$reval = 0.0;}
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
102 push(@re, $reval);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
103 @tmp = ();
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
104 for($i=1; $i<= $#parts; $i++){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
105 if( $parts[$i] eq "NA" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
106 $parts[$i] = 0.0;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
107 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
108 push(@tmp, $parts[$i]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
109 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
110 push(@mat, [@tmp] );
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
111 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
112 else{
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
113 push(@coloffs, 0);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
114 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
115 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
116 close(IN);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
117
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
118 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
119 # rescale matrix so it's between 0 and 1, then multiply by re
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
120 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
121 for($i=0; $i<= $#mat; $i++){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
122 $min = $mat[$i][0];
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
123 $max = $mat[$i][0];
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
124 for($j=1; $j< 5; $j++){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
125 if( $min > $mat[$i][$j] ){ $min = $mat[$i][$j]; }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
126 if( $max < $mat[$i][$j] ){ $max = $mat[$i][$j]; }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
127 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
128 for($j=0; $j< 5; $j++){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
129 if( $max != $min ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
130 $mat[$i][$j] = $re[$i]*(($mat[$i][$j]-$min)/($max-$min));
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
131 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
132 else{
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
133 $mat[$i][$j] = 0;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
134 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
135 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
136 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
137
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
138
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
139 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
140 # print out in stacked format
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
141 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
142 open(OUT,">$name.logo");
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
143 for($i=0; $i<= $#mat; $i++){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
144 $posn = ($mat[$i][0] + $mat[$i][1] + 0.5*$mat[$i][2]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
145 printf OUT ("%f ", -0.5*$mat[$i][2]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
146 printf OUT ("%f ", -$mat[$i][3]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
147 printf OUT ("%f ", -$mat[$i][4]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
148 printf OUT ("%f ", 0.5*$mat[$i][2]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
149 printf OUT ("%f ", $mat[$i][1]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
150 printf OUT ("%f ", $mat[$i][0]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
151 printf OUT ("0 0 0 0 0\n");
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
152 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
153 close(OUT);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
154
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
155 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
156 # make gnu-plotable file
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
157 #
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
158
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
159 # possibly read in conditions to define xtics
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
160 $tics = "";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
161 if( $c ne "" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
162 open(IN,"$c") || die "Error: can't open file $c\n";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
163 @comps = ();
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
164 $i = 0;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
165 while($line = <IN>){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
166 chomp($line);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
167 @parts = split(' ',$line);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
168 if( $#parts != 1 ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
169 print "Error: comparisons list does not have 2 columns\n";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
170 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
171 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
172 if( $coloffs[$i] == 1 ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
173 $val = sprintf("%s vs %s", $parts[0], $parts[1]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
174 push(@comps, $val);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
175 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
176 $i++;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
177 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
178 $tics = "set xtics(\"$comps[0]\" 0";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
179 for($i=1; $i<= $#comps; $i++){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
180 $tics = sprintf("%s, \"%s\" %i", $tics, $comps[$i], $i);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
181 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
182 $tics = sprintf("%s)\nset xtics rotate by -45", $tics);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
183 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
184
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
185 # choose format
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
186 if( $f == 1 ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
187 $format = "postscript eps color 24";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
188 $suff = "eps";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
189 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
190 if( $f == 2 ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
191 $format = "cgm \"Helvetica\" 14";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
192 $suff = "cgm";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
193 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
194
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
195 # set xrange min and max
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
196 $min = -0.5;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
197 $max = $#mat+0.5;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
198
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
199 # possibly turn off key, xlabel, ylabel
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
200 $keytoggle = "";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
201 $xtoggle = "";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
202 $ytoggle = "";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
203 if( $k eq "n" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
204 $keytoggle = "unset key";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
205 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
206 if( $lx eq "n" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
207 $xtoggle = "unset xtics";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
208 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
209 if( $ly eq "n" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
210 $ytoggle = "unset ylabel";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
211 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
212
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
213 # possibly set yrange
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
214 $yrange = "";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
215 if( $yr ne "zzzzzzzzzzz" ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
216 @parts = split(',',$yr);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
217 if( $#parts != 1 ){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
218 print "Error: more than two fields in your -yr value\n";
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
219 exit;
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
220 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
221 $yrange = sprintf("set yrange [%f:%f]", $parts[0], $parts[1]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
222 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
223
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
224 @lines = ( "#!/bin/sh",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
225 "gnuplot << EOF",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
226 "reset",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
227 "set style fill solid 1.00 noborder",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
228 "set style histogram rowstacked",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
229 "set style data histograms",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
230 "set ylabel \"Bits x direction of regulation\"",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
231 "set key outside",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
232 "set xrange [$min: $max]",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
233 "$tics",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
234 "$keytoggle",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
235 "$xtoggle",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
236 "$ytoggle",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
237 "$yrange",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
238 "set terminal $format",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
239 "set output \'$o\'",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
240 "plot \'$name.logo\' u 1 notitle lc rgbcolor \"#000000\", \'\' u 2 notitle lc rgbcolor \"#008800\", \'\' u 3 notitle lc rgbcolor \"#00FF00\", \'\' u 7 t \"++\" lc rgbcolor \"#FF0000\", \'\' u 8 t \"+\" lc rgbcolor \"#880000\", \'\' u 9 t \"0\" lc rgbcolor \"#000000\", \'\' u 10 t \"-\" lc rgbcolor \"#008800\", \'\' u 11 t \"--\" lc rgbcolor \"#00FF00\", \'\' u 4 notitle lc rgbcolor \"#000000\", \'\' u 5 notitle lc rgbcolor \"#880000\", \'\' u 6 notitle lc rgbcolor \"#FF0000\"",
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
241 "EOF"
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
242 );
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
243
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
244 $command = sprintf("%s\n", $lines[0]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
245 for($i=1; $i<= $#lines; $i++){
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
246 $command = sprintf("%s%s\n", $command, $lines[$i]);
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
247 }
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
248
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
249 system("$command");
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
250
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
251
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
252
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
253
003f802d4c7d Uploaded
mmaiensc
parents:
diff changeset
254