3 # quick, very dirty little script so that we can put all the
4 # information for building a residue book set (except the original
5 # partitioning) in one spec file.
9 # >res0_128_128 interleaved
10 # haux res0_96_128aux.vqd 0,4,2
11 # :1 res0_128_128_1.vqd, 4, nonseq cull, 0 +- 1
12 # +1a, 4, nonseq, 0 +- .25 .5
13 # :2 res0_128_128_2.vqd, 4, nonseq, 0 +- 1 2
14 # :3 res0_128_128_3.vqd, 4, nonseq, 0 +- 1 3 5
15 # :4 res0_128_128_4.vqd, 2, nonseq, 0 +- 1 3 5 8 11
16 # :5 res0_128_128_5.vqd, 1, nonseq, 0 +- 1 3 5 8 11 14 17 20 24 28 31 35 39
17 # +1a, 4, nonseq, 0 +- .5 1
20 die "Could not open $ARGV[0]: $!" unless open (F,$ARGV[0]);
25 print "\n#### $line\n\n";
32 if($line=~m/\S+/ && !($line=~m/^\#/) ){
34 print ">>> $command\n";
35 die "Couldn't shell command.\n\tcommand:$command\n"
42 if($line=~m/^>(\S+)\s+(\S*)/){
49 # haux res0_96_128aux.vqd 0,4,2
51 # build a huffman book (no mapping)
52 my($name,$datafile,$arg)=split(' ',$1);
53 my $command="huffbuild $datafile $arg > $globalname$name.vqh";
54 print ">>> $command\n";
55 die "Couldn't build huffbook.\n\tcommand:$command\n"
60 # :1 res0_128_128_1.vqd, 4, nonseq, 0 +- 1
62 my($namedata,$dim,$seqp,$vals)=split(',',$1);
63 my($name,$datafile)=split(' ',$namedata);
68 foreach my$val (split(' ',$vals)){
69 if($val=~/\-?\+?\d+/){
82 die "Couldn't open temp file temp$$.vql: $!" unless
83 open(G,">temp$$.vql");
84 print G "$count $dim 0 ";
92 my $command="latticebuild temp$$.vql > $globalname$name.vqh";
93 print ">>> $command\n";
94 die "Couldn't build latticebook.\n\tcommand:$command\n"
97 my $command="latticehint $globalname$name.vqh > temp$$.vqh";
98 print ">>> $command\n";
99 die "Couldn't pre-hint latticebook.\n\tcommand:$command\n"
102 if($interleave=~/non/){
109 my $command="$restune temp$$.vqh $datafile 1 > $globalname$name.vqh";
110 print ">>> $command\n";
111 die "Couldn't tune latticebook.\n\tcommand:$command\n"
114 my $command="$restune temp$$.vqh $datafile > $globalname$name.vqh";
115 print ">>> $command\n";
116 die "Couldn't tune latticebook.\n\tcommand:$command\n"
120 my $command="latticehint $globalname$name.vqh > temp$$.vqh";
121 print ">>> $command\n";
122 die "Couldn't post-hint latticebook.\n\tcommand:$command\n"
125 my $command="mv temp$$.vqh $globalname$name.vqh";
126 print ">>> $command\n";
127 die "Couldn't rename latticebook.\n\tcommand:$command\n"
130 # run the training data through book to cascade
131 if($interleave=~/non/){
132 $vqcascade="vqcascade";
134 $vqcascade="vqcascade -i";
137 my $command="$vqcascade +$globalname$name.vqh $datafile > temp$$.vqd";
138 print ">>> $command\n";
139 die "Couldn't cascade latticebook.\n\tcommand:$command\n"
143 my $command="rm temp$$.vql";
144 print ">>> $command\n";
145 die "Couldn't remove temp files.\n\tcommand:$command\n"
150 # +a 4, nonseq, 0 +- 1
151 if($line=~m/^\+(.*)/){
152 my($name,$dim,$seqp,$vals)=split(',',$1);
158 foreach my$val (split(' ',$vals)){
159 if($val=~/\-?\+?\d+/){
164 if($plusminus=~/\+/){
172 die "Couldn't open temp file temp$$.vql: $!" unless
173 open(G,">temp$$.vql");
174 print G "$count $dim 0 ";
176 print G "0\n$list\n";
178 print G "1\n$list\n";
182 my $command="latticebuild temp$$.vql > $globalname$name.vqh";
183 print ">>> $command\n";
184 die "Couldn't build latticebook.\n\tcommand:$command\n"
187 my $command="latticehint $globalname$name.vqh > temp$$.vqh";
188 print ">>> $command\n";
189 die "Couldn't pre-hint latticebook.\n\tcommand:$command\n"
192 if($interleave=~/non/){
199 my $command="$restune temp$$.vqh temp$$.vqd 1 > $globalname$name.vqh";
200 print ">>> $command\n";
201 die "Couldn't tune latticebook.\n\tcommand:$command\n"
204 my $command="$restune temp$$.vqh temp$$.vqd > $globalname$name.vqh";
205 print ">>> $command\n";
206 die "Couldn't tune latticebook.\n\tcommand:$command\n"
210 my $command="latticehint $globalname$name.vqh > temp$$.vqh";
211 print ">>> $command\n";
212 die "Couldn't post-hint latticebook.\n\tcommand:$command\n"
215 my $command="mv temp$$.vqh $globalname$name.vqh";
216 print ">>> $command\n";
217 die "Couldn't rename latticebook.\n\tcommand:$command\n"
220 # run the training data through book to cascade
221 if($interleave=~/non/){
222 $vqcascade="vqcascade";
224 $vqcascade="vqcascade -i";
227 my $command="$vqcascade +$globalname$name.vqh temp$$.vqd > tempa$$.vqd";
228 print ">>> $command\n";
229 die "Couldn't cascade latticebook.\n\tcommand:$command\n"
233 my $command="rm temp$$.vql";
234 print ">>> $command\n";
235 die "Couldn't remove temp files.\n\tcommand:$command\n"
238 my $command="mv tempa$$.vqd temp$$.vqd";
239 print ">>> $command\n";
240 die "Couldn't rename temp file.\n\tcommand:$command\n"
247 $command="rm temp$$.vqd";
248 print ">>> $command\n";
249 die "Couldn't remove temp files.\n\tcommand:$command\n"