[Bio] / FigKernelScripts / TransactFeatures.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/TransactFeatures.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3, Thu Aug 11 03:10:35 2005 UTC revision 1.10, Mon Aug 15 20:40:22 2005 UTC
# Line 32  Line 32 
32  a copy of each transaction file in which the pseudo-IDs have been replaced by  a copy of each transaction file in which the pseudo-IDs have been replaced by
33  real IDs.  real IDs.
34    
35    =item annotate
36    
37    Annotate the features created by the transactions so as to indicate how they were
38    derived.
39    
40    =item check
41    
42    Verify that the locations and translations of the new and changed features are
43    correct.
44    
45    =item fix
46    
47    Fix the locations and translations of the new and changed features.
48    
49    =item aliasMove
50    
51    Move the aliases from the old features to the ones that replaced them.
52    
53    =item attribute
54    
55    Move the attributes from the old features to the ones that replaced them.
56    
57    =item attributeCheck
58    
59    Same as C<attribute>, but no changes are made to the database.
60    
61  =back  =back
62    
63  =head2 The Transaction File  =head2 The Transaction File
# Line 140  Line 166 
166  Wrap each organism's processing in a database transaction. This makes the process  Wrap each organism's processing in a database transaction. This makes the process
167  slightly more restartable than it would be otherwise.  slightly more restartable than it would be otherwise.
168    
169    =item noAlias
170    
171    Assume that the transaction files do not contain aliases. This means that in CHANGE
172    records the translation will immediately follow the location.
173    
174    =item sql
175    
176    Trace SQL commands.
177    
178    =back
179    
180  =cut  =cut
181    
182  use strict;  use strict;
# Line 155  Line 192 
192  use ApplyTransactions;  use ApplyTransactions;
193  use CountTransactions;  use CountTransactions;
194  use AnnotateTransactions;  use AnnotateTransactions;
195    use AttributeTransactions;
196  use FixTransactions;  use FixTransactions;
197    use MoveAliases;
198    
199  # Get the command-line options.  # Get the command-line options.
200  my ($options, @parameters) = Tracer::ParseCommand({ trace => 3, safe => 0 }, @ARGV);  my ($options, @parameters) = Tracer::ParseCommand({ trace => 3, sql => 0, safe => 0, noAlias => 0 },
201                                                      @ARGV);
202    # Get the command.
203    my $mainCommand = lc shift @parameters;
204  # Set up tracing.  # Set up tracing.
205  my $traceLevel = $options->{trace};  my $traceLevel = $options->{trace};
206  TSetup("$traceLevel Tracer DocUtils FIG", "TEXT");  my $tracing = "$traceLevel Tracer DocUtils FIG";
207    if ($options->{sql}) {
208        $tracing .= " SQL";
209    }
210    TSetup($tracing, "TEXT");
211  # Get the FIG object.  # Get the FIG object.
212  my $fig = FIG->new();  my $fig = FIG->new();
 # Get the command.  
 my $mainCommand = lc shift @parameters;  
213  # Create the transaction object.  # Create the transaction object.
214  my $controlBlock;  my $controlBlock;
215  if ($mainCommand eq 'count' || $mainCommand eq 'register') {  if ($mainCommand eq 'count' || $mainCommand eq 'register') {
216      $controlBlock = CountTransactions->new($options, $mainCommand, @parameters);      $controlBlock = CountTransactions->new($options, $mainCommand, @parameters);
217  } elsif ($mainCommand eq 'process') {  } elsif ($mainCommand eq 'process') {
218      $controlBlock = ApplyTransactions->new($options, $mainCommand, @parameters);      $controlBlock = ApplyTransactions->new($options, $mainCommand, @parameters);
219  } elsif ($mainCommand eq 'fix') {  } elsif ($mainCommand eq 'annotate') {
220        $controlBlock = AnnotateTransactions->new($options, $mainCommand, @parameters);
221    } elsif ($mainCommand eq 'fix' || $mainCommand eq 'check') {
222      $controlBlock = FixTransactions->new($options, $mainCommand, @parameters);      $controlBlock = FixTransactions->new($options, $mainCommand, @parameters);
223    } elsif ($mainCommand eq 'aliasmove') {
224        $controlBlock = MoveAliases->new($options, $mainCommand, @parameters);
225    } elsif ($mainCommand eq 'attribute') {
226        $controlBlock = AttributeTransactions->new($options, $mainCommand, @parameters);
227    } elsif ($mainCommand eq 'attributeCheck') {
228        $controlBlock = AttributeTransactions->new($options, $mainCommand, @parameters);
229  } else {  } else {
230      Confess("Invalid command \"$mainCommand\" specified on command line.");      Confess("Invalid command \"$mainCommand\" specified on command line.");
231  }  }
# Line 225  Line 277 
277                  } elsif ($command eq 'delete') {                  } elsif ($command eq 'delete') {
278                      $controlBlock->Delete(@fields);                      $controlBlock->Delete(@fields);
279                  } elsif ($command eq 'change') {                  } elsif ($command eq 'change') {
280                        # Here we have a special case. If "noalias" is in effect, we need
281                        # to splice an empty field in before the translation.
282                        if ($controlBlock->Option("noAlias")) {
283                            splice @fields, 3, 0, "";
284                        }
285                      $controlBlock->Change(@fields);                      $controlBlock->Change(@fields);
286                  } else {                  } else {
287                      $controlBlock->AddMessage("Invalid command $command in line $tranCount for genome $genomeID");                      $controlBlock->AddMessage("Invalid command $command in line $tranCount for genome $genomeID");
# Line 233  Line 290 
290              }              }
291              # Terminate processing for this genome.              # Terminate processing for this genome.
292              my $orgStats = $controlBlock->EndGenome();              my $orgStats = $controlBlock->EndGenome();
293              Trace("Statistics for $genomeID\n\n" . $orgStats->Show()) if T(3);              Trace("Statistics for $genomeID\n\n" . $orgStats->Show() . "\n") if T(3);
294              # Close the transaction input file.              # Close the transaction input file.
295              close TRANS;              close TRANS;
296          }          }
297      }      }
298      # Terminate processing.      # Terminate processing.
299      $controlBlock->Teardown();      $controlBlock->Teardown();
300      Trace("Statistics for this run\n\n" . $controlBlock->Show()) if T(1);      Trace("Statistics for this run\n\n" . $controlBlock->Show() . "\n") if T(1);
301      Trace("Processing complete.") if T(1);      Trace("Processing complete.") if T(1);
302  }  }
303    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3